From 85c3ad5e5d17b6420e22c939dffacd74d3351e0b Mon Sep 17 00:00:00 2001 From: Josha von Gizycki Date: Wed, 24 Oct 2018 15:03:32 +0200 Subject: [PATCH] map borders --- resources/public/index.html | 3 +- resources/public/map/map.json | 131 +++++++++++++++++-------- resources/public/map/map.tmx | 155 ++++++++++++++++++------------ src/cljs/topdown2d/core.cljs | 9 +- src/cljs/topdown2d/demoscene.cljs | 22 +++-- 5 files changed, 203 insertions(+), 117 deletions(-) diff --git a/resources/public/index.html b/resources/public/index.html index 5f20a80..f4ab2f7 100644 --- a/resources/public/index.html +++ b/resources/public/index.html @@ -10,8 +10,7 @@ - + diff --git a/resources/public/map/map.json b/resources/public/map/map.json index aa493f3..7fdbadb 100644 --- a/resources/public/map/map.json +++ b/resources/public/map/map.json @@ -1,39 +1,39 @@ -{ "height":16, +{ "height":24, "infinite":false, "layers":[ { - "data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 3, 3, 2, 2, 3, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 2, 3, 2, 2, 2, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 3, 3, 1, 1, 1, 1, 1, 2, 3, 3, 3, 2, 3, 1, 1, 1, 1, 1, 1, 2, 2, 3, 1, 1, 1, 1, 1, 3, 1, 2, 2, 3, 2, 1, 1, 1, 1, 1, 1, 3, 2, 3, 1, 1, 1, 1, 1, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 2, 2, 1, 1, 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, 2, 3, 2, 3, 2, 3, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 2, 3, 1, 1, 2, 3, 3, 1, 2, 2, 1, 1, 3, 2, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 2, 3, 3, 3, 2, 3, 1, 1, 3, 3, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 3, 1, 2, 2, 3, 3, 2, 2, 3, 2, 3, 1, 2, 2, 1, 2, 2, 2, 3, 3, 2, 1, 1, 2, 3, 2, 3, 3, 2, 2, 3, 2, 1, 2, 3, 2, 2, 3, 3, 2, 3, 2, 2, 2, 1, 2, 3, 3, 2, 3, 2, 2, 2, 2, 3, 3, 2, 3, 3, 2, 3, 2, 2, 3, 2, 2, 2, 2, 1, 3, 2, 1, 2, 2, 1, 1, 3, 2, 3, 3, 2, 3, 2, 3, 3, 3, 2, 2, 3, 2, 3, 2, 3, 2, 1, 1, 3, 2, 2, 3], + "height":24, + "id":22, "name":"Hintergrund", "opacity":1, "type":"tilelayer", "visible":true, - "width":20, + "width":30, "x":0, "y":0 }, { - "data":[43, 43, 41, 42, 42, 41, 43, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 43, 43, 43, 43, 41, 42, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 43, 42, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 43, 43, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 43, 42, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 42, 41, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 43, 41, 43, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 43, 41, 43, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 698, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 367, 367, 367, 367, 367, 367, 367, 368, 367, 367, 367, 367, 367, 368, 369, 369, 369, 369, 369, 369, 0, 0, 0, 0, 0, 0, 0, 408, 0, 0, 0, 0, 584, 0, 0, 584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, 626, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, 626, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 407, 369, 369, 369, 369, 369, 409, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - "height":16, - "id":5, + "data":[42, 41, 43, 41, 42, 43, 43, 41, 41, 41, 42, 43, 43, 41, 42, 41, 43, 41, 42, 43, 43, 43, 42, 42, 41, 0, 0, 0, 0, 0, 43, 41, 41, 42, 41, 41, 43, 42, 41, 41, 41, 41, 41, 42, 43, 42, 41, 42, 42, 43, 43, 41, 41, 42, 41, 0, 0, 0, 0, 0, 41, 43, 41, 42, 41, 41, 43, 41, 43, 42, 43, 42, 41, 42, 43, 42, 43, 43, 41, 41, 41, 43, 43, 42, 42, 0, 0, 0, 0, 0, 41, 42, 42, 42, 41, 43, 43, 41, 42, 42, 41, 43, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 43, 43, 43, 43, 42, 43, 43, 43, 43, 41, 42, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 43, 41, 41, 0, 0, 0, 0, 0, 43, 43, 42, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 43, 41, 43, 0, 0, 0, 0, 0, 43, 43, 43, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 43, 42, 43, 0, 0, 0, 0, 0, 42, 43, 42, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 42, 43, 42, 0, 0, 0, 0, 0, 43, 42, 41, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 43, 0, 0, 0, 0, 0, 41, 43, 41, 43, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 43, 43, 0, 0, 0, 0, 0, 43, 43, 41, 43, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 698, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 367, 367, 367, 367, 367, 367, 367, 367, 367, 367, 367, 367, 368, 367, 367, 367, 367, 367, 368, 369, 369, 369, 369, 369, 369, 367, 367, 367, 367, 367, 3, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 408, 0, 0, 0, 0, 584, 0, 0, 584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, 626, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 408, 626, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 407, 369, 369, 369, 369, 369, 409, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":24, + "id":23, "name":"Dekoration", "opacity":1, "type":"tilelayer", "visible":true, - "width":20, + "width":30, "x":0, "y":0 }, { - "data":[0, 0, 0, 0, 0, 0, 0, 0, 82, 82, 82, 82, 82, 81, 82, 81, 81, 82, 81, 82, 0, 0, 0, 0, 0, 0, 0, 0, 81, 337, 338, 339, 0, 0, 52, 0, 10, 11, 82, 81, 82, 82, 82, 82, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 52, 50, 51, 81, 10, 0, 0, 0, 82, 0, 0, 0, 0, 82, 0, 0, 0, 486, 487, 488, 489, 490, 82, 82, 50, 0, 0, 0, 82, 0, 0, 0, 0, 82, 0, 0, 0, 526, 527, 528, 529, 530, 7, 8, 9, 0, 0, 0, 81, 0, 0, 0, 0, 82, 615, 615, 615, 566, 567, 568, 569, 570, 47, 48, 49, 0, 0, 0, 81, 0, 0, 0, 0, 82, 0, 0, 0, 0, 0, 334, 335, 336, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 82, 0, 780, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 81, 82, 82, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 583, 587, 587, 587, 453, 454, 455, 456, 587, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 166, 0, 0, 493, 494, 495, 496, 625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533, 534, 535, 536, 625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 664, 664, 664, 664, 664, 664, 664, 665, 0, 0, 0], - "height":16, - "id":7, + "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 82, 82, 82, 82, 81, 82, 81, 81, 82, 81, 82, 0, 0, 0, 42, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 337, 338, 339, 0, 0, 52, 0, 10, 11, 82, 81, 0, 0, 43, 43, 41, 0, 0, 0, 0, 81, 82, 82, 82, 82, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 52, 50, 51, 81, 10, 11, 0, 0, 42, 41, 0, 0, 0, 0, 82, 0, 0, 0, 82, 0, 0, 0, 0, 82, 0, 0, 0, 486, 487, 488, 489, 490, 82, 82, 50, 51, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 82, 0, 0, 0, 0, 82, 0, 0, 0, 526, 527, 528, 529, 530, 7, 8, 9, 10, 11, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 81, 0, 0, 0, 0, 82, 615, 615, 615, 566, 567, 568, 569, 570, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0, 0, 0, 82, 0, 0, 0, 81, 0, 0, 0, 0, 82, 0, 0, 0, 0, 0, 334, 335, 336, 0, 0, 0, 573, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 81, 0, 0, 0, 0, 82, 0, 780, 0, 0, 0, 0, 0, 0, 0, 0, 0, 573, 0, 0, 0, 0, 82, 82, 81, 82, 82, 0, 0, 0, 82, 81, 82, 82, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 613, 615, 615, 615, 615, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 583, 587, 587, 587, 453, 454, 455, 456, 587, 0, 0, 0, 0, 0, 0, 0, 0, 81, 82, 81, 82, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 166, 0, 0, 493, 494, 495, 496, 625, 0, 0, 0, 10, 11, 7, 8, 9, 0, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533, 534, 535, 536, 625, 0, 0, 0, 50, 51, 47, 48, 49, 0, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 625, 0, 0, 0, 10, 11, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 664, 664, 664, 664, 664, 664, 664, 665, 0, 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, 0, 81, 7, 8, 9, 10, 11, 7, 8, 9, 7, 8, 9, 10, 11, 7, 8, 9, 10, 11, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 81, 47, 48, 49, 50, 51, 47, 48, 49, 47, 48, 49, 50, 51, 47, 48, 49, 50, 51, 47, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":24, + "id":24, "name":"Vordergrund", "opacity":1, "type":"tilelayer", "visible":true, - "width":20, + "width":30, "x":0, "y":0 }, @@ -50,8 +50,8 @@ "type":"", "visible":true, "width":64, - "x":0, - "y":32 + "x":80, + "y":80 }, { "height":96, @@ -61,8 +61,8 @@ "type":"", "visible":true, "width":16, - "x":48, - "y":48 + "x":128, + "y":96 }, { "height":16, @@ -72,8 +72,8 @@ "type":"", "visible":true, "width":48, - "x":64, - "y":128 + "x":144, + "y":176 }, { "height":64, @@ -83,8 +83,8 @@ "type":"", "visible":true, "width":16, - "x":128, - "y":80 + "x":208, + "y":128 }, { "height":48, @@ -94,8 +94,8 @@ "type":"", "visible":true, "width":16, - "x":128, - "y":176 + "x":208, + "y":224 }, { "height":16, @@ -105,8 +105,8 @@ "type":"", "visible":true, "width":144, - "x":128, - "y":240 + "x":208, + "y":288 }, { "height":16, @@ -116,8 +116,8 @@ "type":"", "visible":true, "width":48, - "x":144, - "y":176 + "x":224, + "y":224 }, { "height":48, @@ -127,8 +127,8 @@ "type":"", "visible":true, "width":64, - "x":192, - "y":176 + "x":272, + "y":224 }, { "height":64, @@ -138,8 +138,8 @@ "type":"", "visible":true, "width":16, - "x":256, - "y":176 + "x":336, + "y":224 }, { "height":16, @@ -149,8 +149,8 @@ "type":"", "visible":true, "width":48, - "x":224, - "y":96 + "x":304, + "y":144 }, { "height":16, @@ -160,8 +160,63 @@ "type":"", "visible":true, "width":176, - "x":144, - "y":80 + "x":224, + "y":128 + }, + { + "height":256, + "id":50, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":64, + "y":48 + }, + { + "height":16, + "id":52, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":128, + "x":80, + "y":32 + }, + { + "height":80, + "id":53, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":208, + "y":48 + }, + { + "height":16, + "id":55, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":320, + "x":80, + "y":304 + }, + { + "height":192, + "id":61, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":400, + "y":128 }], "opacity":1, "type":"objectgroup", @@ -169,8 +224,8 @@ "x":0, "y":0 }], - "nextlayerid":10, - "nextobjectid":50, + "nextlayerid":25, + "nextobjectid":62, "orientation":"orthogonal", "renderorder":"right-down", "tiledversion":"2018.09.12", @@ -427,5 +482,5 @@ "tilewidth":16, "type":"map", "version":1.2, - "width":20 + "width":30 } \ No newline at end of file diff --git a/resources/public/map/map.tmx b/resources/public/map/map.tmx index bf8d476..05b65b0 100644 --- a/resources/public/map/map.tmx +++ b/resources/public/map/map.tmx @@ -1,5 +1,5 @@ - + @@ -63,77 +63,106 @@ - + -1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0, -1,1,1,1,1,1,1,1,1,3,2,3,3,2,2,3,2,2,2,3, -1,1,1,1,1,1,1,1,1,2,2,3,2,3,2,2,2,3,3,2, -2,2,2,1,1,1,1,1,1,2,3,3,1,1,1,1,1,2,3,3, -3,2,3,1,1,1,1,1,1,2,2,3,1,1,1,1,1,3,1,2, -2,3,2,1,1,1,1,1,1,3,2,3,1,1,1,1,1,3,3,3, -2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -2,3,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -2,3,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -3,3,3,3,3,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -2,2,2,3,3,3,3,3,2,3,2,2,3,3,2,3,2,2,3,2, -2,2,2,2,2,3,2,3,3,3,2,3,3,2,3,2,2,2,3,3, -3,3,3,2,2,3,2,2,2,2,3,3,3,2,2,3,2,3,2,2, -3,3,2,3,3,2,3,3,3,2,3,3,3,2,3,3,3,2,2,2, -2,3,2,3,2,3,2,3,2,2,3,3,2,2,3,3,2,2,2,3 +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,43,43,42,43,43, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,41,43,41,41,42, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,42,41,43,42,42, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1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3,1,2,2,3,3,2,2,3,2, +3,1,2,2,1,2,2,2,3,3,2,1,1,2,3,2,3,3,2,2,3,2,1,2,3,2,2,3,3,2, +3,2,2,2,1,2,3,3,2,3,2,2,2,2,3,3,2,3,3,2,3,2,2,3,2,2,2,2,1,3, +2,1,2,2,1,1,3,2,3,3,2,3,2,3,3,3,2,2,3,2,3,2,3,2,1,1,3,2,2,3 - + -43,43,41,42,42,41,43,43,0,0,0,0,0,0,0,0,0,0,0,0, -42,43,43,43,43,41,42,43,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,43,43,42,41,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,43,43,43,41,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,42,43,42,41,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,43,42,41,42,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,41,43,41,43,0,0,0,0,0,328,0,0,0,0,0,0, -0,0,0,0,43,43,41,43,0,0,0,0,0,328,0,0,0,0,0,0, -0,0,0,0,0,0,0,698,0,0,0,0,0,328,0,0,0,0,0,0, -0,0,0,0,0,0,0,328,0,0,0,0,0,328,0,0,0,0,0,0, -367,367,367,367,367,367,367,368,367,367,367,367,367,368,369,369,369,369,369,369, -0,0,0,0,0,0,0,408,0,0,0,0,584,0,0,584,0,0,0,0, -0,0,0,0,0,0,0,408,626,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,408,626,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,407,369,369,369,369,369,409,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,666,0,0,0,0,0,0,0,0,0,0,0 +42,41,43,41,42,43,43,41,41,41,42,43,43,41,42,41,43,41,42,43,43,43,42,42,41,0,0,0,0,0, +43,41,41,42,41,41,43,42,41,41,41,41,41,42,43,42,41,42,42,43,43,41,41,42,41,0,0,0,0,0, +41,43,41,42,41,41,43,41,43,42,43,42,41,42,43,42,43,43,41,41,41,43,43,42,42,0,0,0,0,0, +41,42,42,42,41,43,43,41,42,42,41,43,43,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +43,43,43,43,43,42,43,43,43,43,41,42,43,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +43,43,41,41,0,0,0,0,0,43,43,42,41,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +42,43,41,43,0,0,0,0,0,43,43,43,41,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +42,43,42,43,0,0,0,0,0,42,43,42,41,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +41,42,43,42,0,0,0,0,0,43,42,41,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +42,42,42,43,0,0,0,0,0,41,43,41,43,0,0,0,0,0,328,0,0,0,0,0,0,0,0,0,0,0, +42,42,43,43,0,0,0,0,0,43,43,41,43,0,0,0,0,0,328,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,698,0,0,0,0,0,328,0,0,0,0,0,0,0,0,0,0,0, +0,0,3,0,0,0,0,0,0,0,0,0,328,0,0,0,0,0,328,0,0,0,0,0,0,0,0,0,0,0, +367,367,367,367,367,367,367,367,367,367,367,367,368,367,367,367,367,367,368,369,369,369,369,369,369,367,367,367,367,367, +3,0,0,3,0,0,0,0,0,0,0,0,408,0,0,0,0,584,0,0,584,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,408,626,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,2,2,2,0,0,0,0,0,0,0,0,408,626,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,3,3,2,0,0,0,0,0,0,0,0,407,369,369,369,369,369,409,0,0,0,0,0,0,0,0,0,0,0, +3,2,3,0,0,0,0,0,0,0,0,0,0,666,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - + -0,0,0,0,0,0,0,0,82,82,82,82,82,81,82,81,81,82,81,82, -0,0,0,0,0,0,0,0,81,337,338,339,0,0,52,0,10,11,82,81, -82,82,82,82,0,0,0,0,81,0,0,0,0,0,0,52,50,51,81,10, -0,0,0,82,0,0,0,0,82,0,0,0,486,487,488,489,490,82,82,50, -0,0,0,82,0,0,0,0,82,0,0,0,526,527,528,529,530,7,8,9, -0,0,0,81,0,0,0,0,82,615,615,615,566,567,568,569,570,47,48,49, -0,0,0,81,0,0,0,0,82,0,0,0,0,0,334,335,336,0,0,0, -0,0,0,81,0,0,0,0,82,0,780,0,0,0,0,0,0,0,0,0, -0,0,0,82,81,82,82,0,82,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,583,587,587,587,453,454,455,456,587,0,0,0, -0,0,0,0,0,0,0,0,0,166,0,0,493,494,495,496,625,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,533,534,535,536,625,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,625,0,0,0, -0,0,0,0,0,0,0,0,0,664,664,664,664,664,664,664,665,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,82,82,82,82,82,81,82,81,81,82,81,82,0,0,0,42,43, +0,0,0,0,0,0,0,0,0,0,0,0,0,81,337,338,339,0,0,52,0,10,11,82,81,0,0,43,43,41, +0,0,0,0,81,82,82,82,82,0,0,0,0,81,0,0,0,0,0,0,52,50,51,81,10,11,0,0,42,41, +0,0,0,0,82,0,0,0,82,0,0,0,0,82,0,0,0,486,487,488,489,490,82,82,50,51,0,0,0,0, +0,0,0,0,81,0,0,0,82,0,0,0,0,82,0,0,0,526,527,528,529,530,7,8,9,10,11,0,0,0, +0,0,0,0,81,0,0,0,81,0,0,0,0,82,615,615,615,566,567,568,569,570,47,48,49,50,51,0,0,0, +0,0,0,0,82,0,0,0,81,0,0,0,0,82,0,0,0,0,0,334,335,336,0,0,0,573,0,0,0,0, +0,0,0,0,81,0,0,0,81,0,0,0,0,82,0,780,0,0,0,0,0,0,0,0,0,573,0,0,0,0, +82,82,81,82,82,0,0,0,82,81,82,82,0,82,0,0,0,0,0,0,0,0,0,0,0,613,615,615,615,615, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,583,587,587,587,453,454,455,456,587,0,0,0,0,0,0,0,0, +81,82,81,82,82,0,0,0,0,0,0,0,0,0,166,0,0,493,494,495,496,625,0,0,0,10,11,7,8,9, +0,0,0,0,82,0,0,0,0,0,0,0,0,0,0,0,0,533,534,535,536,625,0,0,0,50,51,47,48,49, +0,0,0,0,82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,625,0,0,0,10,11,0,0,0, +0,0,0,0,81,0,0,0,0,0,0,0,0,0,664,664,664,664,664,664,664,665,0,0,0,50,51,0,0,0, +0,0,0,0,81,7,8,9,10,11,7,8,9,7,8,9,10,11,7,8,9,10,11,7,8,9,0,0,0,0, +0,0,0,0,81,47,48,49,50,51,47,48,49,47,48,49,50,51,47,48,49,50,51,47,48,49,0,0,0,0, +0,0,0,0,81,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,81,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/src/cljs/topdown2d/core.cljs b/src/cljs/topdown2d/core.cljs index 4000b4d..48912a4 100644 --- a/src/cljs/topdown2d/core.cljs +++ b/src/cljs/topdown2d/core.cljs @@ -19,8 +19,8 @@ ;; difference between prev and now in seconds :elapsed 0} ;; width and height of the canvas - :dimensions {:w 1280 - :h 800} + :dimensions {:w (* 16 11 3) + :h (* 16 9 3)} :input {:dir :?} ;; currently active scene :scene :demo @@ -151,9 +151,8 @@ (defn init-scenes "initiates the scene data maps using their respective init functions" [] - (as-> (:canvas gamestate) c - (set! (.-width c) (get-in gamestate [:dimensions :w])) - (set! (.-height c) (get-in gamestate [:dimensions :h]))) + (set! (.-width (:canvas gamestate)) (get-in gamestate [:dimensions :w])) + (set! (.-height (:canvas gamestate)) (get-in gamestate [:dimensions :h])) (update gamestate :scenes #(reduce diff --git a/src/cljs/topdown2d/demoscene.cljs b/src/cljs/topdown2d/demoscene.cljs index d8649ba..92c793d 100644 --- a/src/cljs/topdown2d/demoscene.cljs +++ b/src/cljs/topdown2d/demoscene.cljs @@ -26,11 +26,12 @@ :curr-id 778 :tileset :pokelike}} :viewport {:keep-in {:x 0 :y 0 - :w 2239 :h 2235} + :w 0 :h 0} :tileset :pokelike - :x 1 :y 1 + :x (* 16 6 3) :y (* 16 9 3) :w (get-in gamestate [:dimensions :w]) :h (get-in gamestate [:dimensions :h]) + :d :? ;; pixels per second :pps 150}})) @@ -57,17 +58,20 @@ (-> scenestate (assoc-in [:map-def :def] loaded-def) (update-in [:map-def :def] - (partial tileset/prepare-map-def zoom)))) + (partial tileset/prepare-map-def zoom)) + (assoc-in [:viewport :keep-in :w] (* (dec (:width loaded-def)) 3 16)) + (assoc-in [:viewport :keep-in :h] (* (dec (:height loaded-def)) 3 16)))) scenestate)) (defn update-scene [gamestate scenestate] - (let [player (:player scenestate) - viewport (:viewport scenestate) + (let [new-scenestate (init-map-def scenestate) + player (:player new-scenestate) + viewport (:viewport new-scenestate) dir (get-in gamestate [:input :dir])] - (-> scenestate - init-map-def - (assoc :player (update-player gamestate player dir) - :viewport (update-viewport gamestate viewport dir))))) + (println viewport) + (assoc new-scenestate + :player (update-player gamestate player dir) + :viewport (update-viewport gamestate viewport dir)))) (defn draw-scene [gamestate scenestate] (let [viewport (:viewport scenestate)