aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-06-03 14:51:59 +0200
committerAstatin <[email protected]>2025-06-03 14:51:59 +0200
commiteca91612b60b5379f9e8d6ce6f51366db54aacc3 (patch)
treec5fad4dc000a5430958fa8b354f69b3ba6628fe6
parentf3a70613f78023c25d9a075231cb55639a75ee99 (diff)
Add loading from pregenerated collision map
-rw-r--r--Makefile23
-rw-r--r--TODO2
-rw-r--r--definitions.gbasm4
-rw-r--r--entity/init.gbasm179
-rw-r--r--main.gbasm3
-rw-r--r--map/loading.gbasm8
-rw-r--r--map/maps.gbasm2
-rw-r--r--map/maps/test.ldtk1278
-rw-r--r--map/maps/test.map.gbasm10
-rw-r--r--map/utils.gbasm41
-rw-r--r--modes/dungeongeneration.gbasm4
-rw-r--r--modes/maploading.gbasm172
-rw-r--r--modes/vblank_handler_list.gbasm4
-rw-r--r--scripts/parse-ldtkmap.py33
-rw-r--r--tileset.gbasm1
15 files changed, 1633 insertions, 131 deletions
diff --git a/Makefile b/Makefile
index 0c6109c..8318a40 100644
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,28 @@
all: run
-.PHONY: build/main.rom.unsigned build/main.rom clean
+.PHONY: clean sclean
tileset.gbasm: ./scripts/generate-tiledata.py $(wildcard ./sprites/**/* ./sprites/*)
- python ./scripts/generate-tiledata.py > tileset.gbasm
+ @echo "; THIS FILE IS GENERATED AUTOMATICALLY, DO NOT CHANGE" > $@
+ python ./scripts/generate-tiledata.py >> $@
%.gbasm: ./%.gbtxt ./scripts/generate_from_gbtxt.py
- python ./scripts/generate_from_gbtxt.py $< > $@
+ @echo "; THIS FILE IS GENERATED AUTOMATICALLY, DO NOT CHANGE" > $@
+ python ./scripts/generate_from_gbtxt.py $< >> $@
+
+%.map.gbasm: ./%.ldtk ./scripts/parse-ldtkmap.py
+ @echo "; THIS FILE IS GENERATED AUTOMATICALLY, DO NOT CHANGE" > $@
+ python ./scripts/parse-ldtkmap.py $< >> $@
+
+map/maps.gbasm: $(subst .ldtk,.map.gbasm,$(wildcard ./map/maps/*.ldtk))
+ @echo "; THIS FILE IS GENERATED AUTOMATICALLY, DO NOT CHANGE" > $@
+ ls ./map/maps/*.map.gbasm | sed 's/^\.\///' | awk '{print ".INCLUDE \""$$0"\"" }' >> $@
build/main.rom: build/main.rom.unsigned
cp build/main.rom.unsigned build/main.rom
python scripts/set_checksums.py build/main.rom
-build/main.rom.unsigned: main.gbasm tileset.gbasm text.gbasm dialogues/text.gbasm
+build/main.rom.unsigned: main.gbasm tileset.gbasm text.gbasm dialogues/text.gbasm map/maps.gbasm $(wildcard ./*.gbasm) $(wildcard ./**/*.gbasm)
mkdir -p build
gbasm $< $@ > build/main.sym
@@ -28,3 +38,8 @@ gearboy: build/main.rom
clean:
rm -rf build
+
+sclean: clean
+ rm tileset.gbasm
+ find . -name "*.gbtxt" | sed 's/\.gbtxt$/.gbasm/' | xargs rm
+ rm map/maps/*.map.gbasm map/maps.gbasm
diff --git a/TODO b/TODO
index aafbeaf..f6a1d4f 100644
--- a/TODO
+++ b/TODO
@@ -76,6 +76,6 @@ x -> Find a way to control the difficulty level so its easier at the start and h
-> Human realises that they became nihilistic and in wanting to save others, forgot to save themselves and actually really miss home and want now to find their way out
-> human stop giving up
-> A thing that was barely relevant during the human rescue mission is actually a first small hint to their way back home
- -> things happening
+ -> things happening (very linearly very fast and people are excited)
-> Human finally find their way home and go back in an emotional goodbye
-> end
diff --git a/definitions.gbasm b/definitions.gbasm
index c4ae844..b9e3c68 100644
--- a/definitions.gbasm
+++ b/definitions.gbasm
@@ -16,6 +16,8 @@
.DEFINE VRAM_start $8000
.DEFINE OAM_start $FE00
+.DEFINE VRAM_tilemap_1 $9800
+
.DEFINE dungeon_generation_step $20
.DEFINE intial_duplication_probablity $01
@@ -49,7 +51,7 @@
.DEFINE mem_rng_state_2 ($c00b) ; 2 bytes
.DEFINE mem_map_loading_flags ($c00c)
-; bit 0: if the object should be reloaded (scroll or first load)
+; bit 0: scroll or first load (object loading and load map)
; bit 1: has a movement ended (objects interaction should be checked, entities should update their positions)
; bit 2: if the prepared block should be updated at the next frame
; bit 3: animation step is going up (?)
diff --git a/entity/init.gbasm b/entity/init.gbasm
index 38d3141..e0272be 100644
--- a/entity/init.gbasm
+++ b/entity/init.gbasm
@@ -1,8 +1,8 @@
Initialize_Entities:
LD A, $mem_bunny_mana
- LD C, A
+ LD E, A
LD A, $mem_bunny_health
- LD B, A
+ LD D, A
LD HL, $mem_entities_list
Clear_Entities.loop:
XOR A
@@ -10,58 +10,74 @@ Initialize_Entities:
CP L
JR NZ, =Clear_Entities.loop
- LD A, B
+ LD A, D
LD $mem_bunny_health, A
- LD A, C
+ LD A, E
LD $mem_bunny_mana, A
- LD HL, $mem_entities_list
- LD A, $01
- LD (HL+), A
+ CALL =Initialize_Bunny_Random_room
- LD A, $mem_number_of_rooms
- CALL =RNG_Bound
+ LD A, $00
+ LD $mem_enemies_alive_count, A
+
+ LD A, $mem_bunny_current_room_idx
LD $tmp_var_1, A
- SLA A
- SLA A
- ADD low($mem_room_list)
- LD C, A
+ LD A, $ff
+ LD $mem_bunny_current_room_idx, A
- LD B, high($mem_room_list)
+ LD A, $00
+ LD $tmp_var_3, A
+ CALL =Initialize_Enemy
+ CALL =Initialize_Enemy
+ CALL =Initialize_Enemy
+ CALL =Initialize_Enemy
+ CALL =Initialize_Enemy
+ LD A, $tmp_var_1
+ LD $mem_bunny_current_room_idx, A
- LD A, (BC)
- LD D, A
- INC BC
- LD A, (BC)
- INC A
- CALL =RNG_Bound
- ADD D
+ CALL =Reset_Entities_Collision_Map
- LD (HL+), A
+Reset_viewport_thingies:
+ LD A, $mem_bunny_x
+ SUB $05
+ LD $mem_viewport_x, A
- INC BC
+ LD A, $mem_bunny_y
+ SUB $04
+ LD $mem_viewport_y, A
- LD A, (BC)
- LD D, A
- INC BC
- LD A, (BC)
- INC A
- CALL =RNG_Bound
- ADD D
+ LD A, $mem_viewport_x
+ SWAP A
+ AND $f0
+ OR $08
+ LD $mem_prepared_viewport_x, A
- LD (HL), A
+ LD A, $mem_viewport_y
+ SWAP A
+ AND $f0
+ OR $08
+ LD $mem_prepared_viewport_y, A
- PUSH BC
- LD C, (HL)
- DEC HL
- LD B, (HL)
+ RET
+
+Initialize_Bunny_Random_room:
+ LD A, $ff
+ CALL =Pick_Random_Room_Avoid_A
+ LD $mem_bunny_current_room_idx, A
+ CALL =Pick_Room_position
+
+Initialize_Bunny: ; BC is XY position
+ LD HL, $mem_entities_list
+ LD A, $01
+ LD (HL+), A
+
+ LD (HL), B
INC HL
+ LD (HL), C
CALL =Carve_Entity_Collision_Map
- POP BC
-
INC HL
LD A, $enum_direction_down
@@ -92,45 +108,6 @@ Initialize_Entities:
AND $f0
ADD $10
LD L, A
-
- LD A, $00
- LD $mem_enemies_alive_count, A
-
- LD A, $ff
- LD $mem_bunny_current_room_idx, A
-
- LD A, $00
- LD $tmp_var_3, A
- CALL =Initialize_Enemy
- CALL =Initialize_Enemy
- CALL =Initialize_Enemy
- CALL =Initialize_Enemy
- CALL =Initialize_Enemy
- LD A, $tmp_var_1
- LD $mem_bunny_current_room_idx, A
-
- CALL =Reset_Entities_Collision_Map
-
- LD A, $mem_bunny_x
- SUB $05
- LD $mem_viewport_x, A
-
- LD A, $mem_bunny_y
- SUB $04
- LD $mem_viewport_y, A
-
- LD A, $mem_viewport_x
- SWAP A
- AND $f0
- OR $08
- LD $mem_prepared_viewport_x, A
-
- LD A, $mem_viewport_y
- SWAP A
- AND $f0
- OR $08
- LD $mem_prepared_viewport_y, A
-
RET
Initialize_Enemy: ; HL => pointer to entity struct
@@ -147,58 +124,19 @@ Initialize_Entity: ; HL => pointer to entity struct, A => entity loaded index, 1
SLA A
ADD B
INC A
- LD (HL+), A
+ LD (HL), A
LD A, $mem_bunny_current_room_idx
- CALL =Pick_Random_Room_Avoid_A
-
- SLA A
- SLA A
- ADD low($mem_room_list)
- LD C, A
-
- LD B, high($mem_room_list)
-
- ; X
- LD A, (BC)
- LD D, A
- INC BC
- LD A, (BC)
- INC A
- CALL =RNG_Bound
- ADD D
-
- LD (HL+), A
-
- INC BC
-
- ; Y
- LD A, (BC)
- LD D, A
- INC BC
- LD A, (BC)
- INC A
- CALL =RNG_Bound
- ADD D
- LD (HL), A
+ CALL =Pick_Room_position_Avoid_A
; Check if spawning on collisionable tile
- PUSH BC
- LD C, (HL)
- DEC HL
- LD B, (HL)
- INC HL
-
CALL =Is_Collisionable
CP $00
JR Z, =.no_collision
XOR A
- LD (HL-), A
- LD (HL-), A
LD (HL), A
- POP BC
LD A, $tmp_var_3
CP $01
@@ -209,6 +147,13 @@ Initialize_Entity: ; HL => pointer to entity struct, A => entity loaded index, 1
JP =Initialize_Entity
.no_collision:
+
+ INC HL
+ LD (HL), B
+ INC HL
+ LD (HL), C
+ INC HL
+
CALL =Carve_Entity_Collision_Map
POP BC
diff --git a/main.gbasm b/main.gbasm
index 6305b82..a8ec0c7 100644
--- a/main.gbasm
+++ b/main.gbasm
@@ -121,7 +121,7 @@ Entrypoint:
CALL =Load_Tile
- JP =New_Dungeon
+ JP =Map_Loading
.INCLUDE "tiles.gbasm"
.INCLUDE "rng.gbasm"
@@ -149,3 +149,4 @@ Entrypoint:
.INCLUDE "tileset.gbasm"
.INCLUDE "text.gbasm"
.INCLUDE "dialogues/dialogues.gbasm"
+.INCLUDE "map/maps.gbasm"
diff --git a/map/loading.gbasm b/map/loading.gbasm
index 1247b08..c0ea14f 100644
--- a/map/loading.gbasm
+++ b/map/loading.gbasm
@@ -14,8 +14,8 @@ Load_Prepared_Map:
LD A, C
CALL =Load_Block
LD A, $mem_prepared_block_position_1
- SUB $98
- ADD $c4
+ SUB high($VRAM_tilemap_1)
+ ADD high($mem_map_loading_buffer)
LD $mem_prepared_block_position_1, A
CALL =Display_Main_Prepared_Block
@@ -159,7 +159,7 @@ Construct_Tile_Address: ; Construct Tile Map address from A and B in DE
OR E
LD E, A
LD A, D
- OR $98
+ OR high($VRAM_tilemap_1)
LD D, A
POP BC
@@ -303,8 +303,6 @@ Display_Main_Prepared_Block:
PUSH BC
PUSH DE
-
-
LD A, $mem_prepared_block_position_1
LD D, A
diff --git a/map/maps.gbasm b/map/maps.gbasm
new file mode 100644
index 0000000..86703f6
--- /dev/null
+++ b/map/maps.gbasm
@@ -0,0 +1,2 @@
+; THIS FILE IS GENERATED AUTOMATICALLY, DO NOT CHANGE
+.INCLUDE "map/maps/test.map.gbasm"
diff --git a/map/maps/test.ldtk b/map/maps/test.ldtk
new file mode 100644
index 0000000..6a53cb3
--- /dev/null
+++ b/map/maps/test.ldtk
@@ -0,0 +1,1278 @@
+{
+ "__header__": {
+ "fileType": "LDtk Project JSON",
+ "app": "LDtk",
+ "doc": "https://ldtk.io/json",
+ "schema": "https://ldtk.io/files/JSON_SCHEMA.json",
+ "appAuthor": "Sebastien 'deepnight' Benard",
+ "appVersion": "1.5.3",
+ "url": "https://ldtk.io"
+ },
+ "iid": "a44281a0-3740-11f0-9e9d-278017e89d25",
+ "jsonVersion": "1.5.3",
+ "appBuildId": 485696,
+ "nextUid": 72,
+ "identifierStyle": "Capitalize",
+ "toc": [],
+ "worldLayout": "Free",
+ "worldGridWidth": 256,
+ "worldGridHeight": 256,
+ "defaultLevelWidth": 256,
+ "defaultLevelHeight": 256,
+ "defaultPivotX": 0,
+ "defaultPivotY": 0,
+ "defaultGridSize": 16,
+ "defaultEntityWidth": 16,
+ "defaultEntityHeight": 16,
+ "bgColor": "#40465B",
+ "defaultLevelBgColor": "#696A79",
+ "minifyJson": false,
+ "externalLevels": false,
+ "exportTiled": false,
+ "simplifiedExport": false,
+ "imageExportMode": "None",
+ "exportLevelBg": true,
+ "pngFilePattern": null,
+ "backupOnSave": false,
+ "backupLimit": 10,
+ "backupRelPath": null,
+ "levelNamePattern": "Level_%idx",
+ "tutorialDesc": null,
+ "customCommands": [],
+ "flags": [],
+ "defs": { "layers": [
+ {
+ "__type": "AutoLayer",
+ "identifier": "AutoLayer",
+ "type": "AutoLayer",
+ "uid": 3,
+ "doc": null,
+ "uiColor": null,
+ "gridSize": 16,
+ "guideGridWid": 0,
+ "guideGridHei": 0,
+ "displayOpacity": 1,
+ "inactiveOpacity": 1,
+ "hideInList": false,
+ "hideFieldsWhenInactive": false,
+ "canSelectWhenInactive": true,
+ "renderInWorldView": true,
+ "pxOffsetX": 0,
+ "pxOffsetY": 0,
+ "parallaxFactorX": 0,
+ "parallaxFactorY": 0,
+ "parallaxScaling": true,
+ "requiredTags": [],
+ "excludedTags": [],
+ "autoTilesKilledByOtherLayerUid": null,
+ "uiFilterTags": [],
+ "useAsyncRender": false,
+ "intGridValues": [],
+ "intGridValuesGroups": [],
+ "autoRuleGroups": [
+ {
+ "uid": 5,
+ "name": "tree",
+ "color": null,
+ "icon": null,
+ "active": true,
+ "isOptional": false,
+ "rules": [
+ {
+ "uid": 47,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[0]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,-2,0,-2,2,-2,0,-2,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 8258583,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 48,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[15]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [-2,2,-2,2,2,2,-2,2,-2],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 1095317,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 49,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[10]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,-2,0,-2,2,2,0,2,-2],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 9027935,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 50,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[9]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,-2,0,2,2,-2,-2,2,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 206536,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 51,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[5]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [-2,2,0,2,2,-2,0,-2,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 1477462,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 52,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[6]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,2,-2,-2,2,2,0,-2,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 3875129,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 53,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[2]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,-2,0,-2,2,0,0,-2,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 993969,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 54,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[1]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,-2,0,0,2,-2,0,-2,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 1815458,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 55,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[3]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,-2,0,0,2,0,0,-2,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 7520826,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 56,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[8]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,-2,0,-2,2,-2,0,0,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 1298806,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 57,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[4]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,0,0,-2,2,-2,0,-2,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 6138938,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 58,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[12]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,0,0,-2,2,-2,0,0,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 8301447,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 59,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[10]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,-2,0,-2,2,0,0,0,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 2630524,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 60,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[9]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,-2,0,0,2,-2,0,0,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 6170170,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 61,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[5]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,0,0,0,2,-2,0,-2,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 1032262,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 62,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[6]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,0,0,-2,2,0,0,-2,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 1857926,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 63,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[11]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,-2,0,0,2,0,0,0,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 9679621,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 64,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[13]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,0,0,0,2,-2,0,0,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 9005051,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 65,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[7]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,0,0,0,2,0,0,-2,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 7455444,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 66,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[14]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,0,0,-2,2,0,0,0,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 5100188,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 67,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[15]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [-2,2,0,2,2,0,0,0,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 508964,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 68,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[15]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,2,-2,0,2,2,0,0,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 7130674,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 69,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[15]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,0,0,0,2,2,0,2,-2],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 8340532,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 70,
+ "active": true,
+ "size": 3,
+ "tileRectsIds": [[15]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [0,0,0,2,2,0,-2,2,0],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 6176984,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ },
+ {
+ "uid": 71,
+ "active": true,
+ "size": 1,
+ "tileRectsIds": [[15]],
+ "alpha": 1,
+ "chance": 1,
+ "breakOnMatch": true,
+ "pattern": [2],
+ "flipX": false,
+ "flipY": false,
+ "xModulo": 1,
+ "yModulo": 1,
+ "xOffset": 0,
+ "yOffset": 0,
+ "tileXOffset": 0,
+ "tileYOffset": 0,
+ "tileRandomXMin": 0,
+ "tileRandomXMax": 0,
+ "tileRandomYMin": 0,
+ "tileRandomYMax": 0,
+ "checker": "None",
+ "tileMode": "Single",
+ "pivotX": 0,
+ "pivotY": 0,
+ "outOfBoundsValue": 2,
+ "invalidated": false,
+ "perlinActive": false,
+ "perlinSeed": 4693847,
+ "perlinScale": 0.2,
+ "perlinOctaves": 2
+ }
+ ],
+ "usesWizard": true,
+ "requiredBiomeValues": [],
+ "biomeRequirementMode": 0
+ }
+ ],
+ "autoSourceLayerDefUid": 2,
+ "tilesetDefUid": 1,
+ "tilePivotX": 0,
+ "tilePivotY": 0,
+ "biomeFieldUid": null
+ },
+ {
+ "__type": "Tiles",
+ "identifier": "AutoLayer_baked",
+ "type": "Tiles",
+ "uid": 4,
+ "doc": null,
+ "uiColor": null,
+ "gridSize": 16,
+ "guideGridWid": 0,
+ "guideGridHei": 0,
+ "displayOpacity": 1,
+ "inactiveOpacity": 1,
+ "hideInList": false,
+ "hideFieldsWhenInactive": false,
+ "canSelectWhenInactive": true,
+ "renderInWorldView": true,
+ "pxOffsetX": 0,
+ "pxOffsetY": 0,
+ "parallaxFactorX": 0,
+ "parallaxFactorY": 0,
+ "parallaxScaling": true,
+ "requiredTags": [],
+ "excludedTags": [],
+ "autoTilesKilledByOtherLayerUid": null,
+ "uiFilterTags": [],
+ "useAsyncRender": false,
+ "intGridValues": [],
+ "intGridValuesGroups": [],
+ "autoRuleGroups": [],
+ "autoSourceLayerDefUid": null,
+ "tilesetDefUid": 1,
+ "tilePivotX": 0,
+ "tilePivotY": 0,
+ "biomeFieldUid": null
+ },
+ {
+ "__type": "IntGrid",
+ "identifier": "Things",
+ "type": "IntGrid",
+ "uid": 2,
+ "doc": null,
+ "uiColor": null,
+ "gridSize": 16,
+ "guideGridWid": 0,
+ "guideGridHei": 0,
+ "displayOpacity": 1,
+ "inactiveOpacity": 1,
+ "hideInList": false,
+ "hideFieldsWhenInactive": false,
+ "canSelectWhenInactive": true,
+ "renderInWorldView": true,
+ "pxOffsetX": 0,
+ "pxOffsetY": 0,
+ "parallaxFactorX": 0,
+ "parallaxFactorY": 0,
+ "parallaxScaling": true,
+ "requiredTags": [],
+ "excludedTags": [],
+ "autoTilesKilledByOtherLayerUid": null,
+ "uiFilterTags": [],
+ "useAsyncRender": false,
+ "intGridValues": [
+ { "value": 1, "identifier": "empty", "color": "#E0F8D0", "tile": null, "groupUid": 0 },
+ { "value": 2, "identifier": "tree", "color": "#346856", "tile": null, "groupUid": 0 }
+ ],
+ "intGridValuesGroups": [],
+ "autoRuleGroups": [],
+ "autoSourceLayerDefUid": null,
+ "tilesetDefUid": null,
+ "tilePivotX": 0,
+ "tilePivotY": 0,
+ "biomeFieldUid": null
+ }
+ ], "entities": [], "tilesets": [
+ {
+ "__cWid": 4,
+ "__cHei": 4,
+ "identifier": "Tree_tileset",
+ "uid": 1,
+ "relPath": "../../sprites/bg/tree-tileset.png",
+ "embedAtlas": null,
+ "pxWid": 64,
+ "pxHei": 64,
+ "tileGridSize": 16,
+ "spacing": 0,
+ "padding": 0,
+ "tags": [],
+ "tagsSourceEnumUid": null,
+ "enumTags": [],
+ "customData": [],
+ "savedSelections": [],
+ "cachedPixelData": { "opaqueTiles": "1111111111111111", "averageColors": "f897f797f897f797f787f686f787f686f797f797f797f787f786f686f686f575" }
+ }
+ ], "enums": [], "externalEnums": [], "levelFields": [] },
+ "levels": [
+ {
+ "identifier": "Level_0",
+ "iid": "a4436c00-3740-11f0-9e9d-69511a8c9b7b",
+ "uid": 0,
+ "worldX": 0,
+ "worldY": 0,
+ "worldDepth": 0,
+ "pxWid": 512,
+ "pxHei": 512,
+ "__bgColor": "#696A79",
+ "bgColor": null,
+ "useAutoIdentifier": true,
+ "bgRelPath": null,
+ "bgPos": null,
+ "bgPivotX": 0.5,
+ "bgPivotY": 0.5,
+ "__smartColor": "#ADADB5",
+ "__bgPos": null,
+ "externalRelPath": null,
+ "fieldInstances": [],
+ "layerInstances": [
+ {
+ "__identifier": "AutoLayer",
+ "__type": "AutoLayer",
+ "__cWid": 32,
+ "__cHei": 32,
+ "__gridSize": 16,
+ "__opacity": 1,
+ "__pxTotalOffsetX": 0,
+ "__pxTotalOffsetY": 0,
+ "__tilesetDefUid": 1,
+ "__tilesetRelPath": "../../sprites/bg/tree-tileset.png",
+ "iid": "663fc2e0-3740-11f0-9e9d-2794dd41d15e",
+ "levelId": 0,
+ "layerDefUid": 3,
+ "pxOffsetX": 0,
+ "pxOffsetY": 0,
+ "visible": true,
+ "optionalRules": [],
+ "intGridCsv": [],
+ "autoLayerTiles": [
+ { "px": [208,176], "src": [48,48], "f": 0, "t": 15, "d": [71,365], "a": 1 },
+ { "px": [192,176], "src": [48,48], "f": 0, "t": 15, "d": [70,364], "a": 1 },
+ { "px": [224,176], "src": [48,48], "f": 0, "t": 15, "d": [69,366], "a": 1 },
+ { "px": [208,192], "src": [48,48], "f": 0, "t": 15, "d": [69,397], "a": 1 },
+ { "px": [192,160], "src": [48,48], "f": 0, "t": 15, "d": [68,332], "a": 1 },
+ { "px": [224,160], "src": [48,48], "f": 0, "t": 15, "d": [67,334], "a": 1 },
+ { "px": [208,64], "src": [32,48], "f": 0, "t": 14, "d": [66,141], "a": 1 },
+ { "px": [384,96], "src": [32,48], "f": 0, "t": 14, "d": [66,216], "a": 1 },
+ { "px": [384,112], "src": [32,48], "f": 0, "t": 14, "d": [66,248], "a": 1 },
+ { "px": [176,160], "src": [32,48], "f": 0, "t": 14, "d": [66,331], "a": 1 },
+ { "px": [352,224], "src": [32,48], "f": 0, "t": 14, "d": [66,470], "a": 1 },
+ { "px": [352,464], "src": [48,16], "f": 0, "t": 7, "d": [65,950], "a": 1 },
+ { "px": [112,160], "src": [16,48], "f": 0, "t": 13, "d": [64,327], "a": 1 },
+ { "px": [240,160], "src": [16,48], "f": 0, "t": 13, "d": [64,335], "a": 1 },
+ { "px": [400,96], "src": [48,32], "f": 0, "t": 11, "d": [63,217], "a": 1 },
+ { "px": [208,160], "src": [48,32], "f": 0, "t": 11, "d": [63,333], "a": 1 },
+ { "px": [352,208], "src": [48,32], "f": 0, "t": 11, "d": [63,438], "a": 1 },
+ { "px": [368,208], "src": [48,32], "f": 0, "t": 11, "d": [63,439], "a": 1 },
+ { "px": [176,176], "src": [32,16], "f": 0, "t": 6, "d": [62,363], "a": 1 },
+ { "px": [192,192], "src": [32,16], "f": 0, "t": 6, "d": [62,396], "a": 1 },
+ { "px": [400,112], "src": [16,16], "f": 0, "t": 5, "d": [61,249], "a": 1 },
+ { "px": [240,176], "src": [16,16], "f": 0, "t": 5, "d": [61,367], "a": 1 },
+ { "px": [224,192], "src": [16,16], "f": 0, "t": 5, "d": [61,398], "a": 1 },
+ { "px": [368,224], "src": [16,16], "f": 0, "t": 5, "d": [61,471], "a": 1 },
+ { "px": [192,144], "src": [16,32], "f": 0, "t": 9, "d": [60,300], "a": 1 },
+ { "px": [240,144], "src": [16,32], "f": 0, "t": 9, "d": [60,303], "a": 1 },
+ { "px": [176,144], "src": [32,32], "f": 0, "t": 10, "d": [59,299], "a": 1 },
+ { "px": [224,144], "src": [32,32], "f": 0, "t": 10, "d": [59,302], "a": 1 },
+ { "px": [32,48], "src": [0,48], "f": 0, "t": 12, "d": [58,98], "a": 1 },
+ { "px": [240,48], "src": [0,48], "f": 0, "t": 12, "d": [58,111], "a": 1 },
+ { "px": [32,64], "src": [0,48], "f": 0, "t": 12, "d": [58,130], "a": 1 },
+ { "px": [96,64], "src": [0,48], "f": 0, "t": 12, "d": [58,134], "a": 1 },
+ { "px": [128,64], "src": [0,48], "f": 0, "t": 12, "d": [58,136], "a": 1 },
+ { "px": [176,64], "src": [0,48], "f": 0, "t": 12, "d": [58,139], "a": 1 },
+ { "px": [208,80], "src": [0,48], "f": 0, "t": 12, "d": [58,173], "a": 1 },
+ { "px": [416,80], "src": [0,48], "f": 0, "t": 12, "d": [58,186], "a": 1 },
+ { "px": [464,96], "src": [0,48], "f": 0, "t": 12, "d": [58,221], "a": 1 },
+ { "px": [304,112], "src": [0,48], "f": 0, "t": 12, "d": [58,243], "a": 1 },
+ { "px": [464,112], "src": [0,48], "f": 0, "t": 12, "d": [58,253], "a": 1 },
+ { "px": [304,128], "src": [0,48], "f": 0, "t": 12, "d": [58,275], "a": 1 },
+ { "px": [464,128], "src": [0,48], "f": 0, "t": 12, "d": [58,285], "a": 1 },
+ { "px": [112,144], "src": [0,48], "f": 0, "t": 12, "d": [58,295], "a": 1 },
+ { "px": [464,144], "src": [0,48], "f": 0, "t": 12, "d": [58,317], "a": 1 },
+ { "px": [320,160], "src": [0,48], "f": 0, "t": 12, "d": [58,340], "a": 1 },
+ { "px": [112,176], "src": [0,48], "f": 0, "t": 12, "d": [58,359], "a": 1 },
+ { "px": [320,176], "src": [0,48], "f": 0, "t": 12, "d": [58,372], "a": 1 },
+ { "px": [448,288], "src": [0,48], "f": 0, "t": 12, "d": [58,604], "a": 1 },
+ { "px": [256,304], "src": [0,48], "f": 0, "t": 12, "d": [58,624], "a": 1 },
+ { "px": [448,304], "src": [0,48], "f": 0, "t": 12, "d": [58,636], "a": 1 },
+ { "px": [256,320], "src": [0,48], "f": 0, "t": 12, "d": [58,656], "a": 1 },
+ { "px": [256,336], "src": [0,48], "f": 0, "t": 12, "d": [58,688], "a": 1 },
+ { "px": [336,336], "src": [0,48], "f": 0, "t": 12, "d": [58,693], "a": 1 },
+ { "px": [368,336], "src": [0,48], "f": 0, "t": 12, "d": [58,695], "a": 1 },
+ { "px": [432,336], "src": [0,48], "f": 0, "t": 12, "d": [58,699], "a": 1 },
+ { "px": [176,80], "src": [0,16], "f": 0, "t": 4, "d": [57,171], "a": 1 },
+ { "px": [384,128], "src": [0,16], "f": 0, "t": 4, "d": [57,280], "a": 1 },
+ { "px": [208,208], "src": [0,16], "f": 0, "t": 4, "d": [57,429], "a": 1 },
+ { "px": [352,240], "src": [0,16], "f": 0, "t": 4, "d": [57,502], "a": 1 },
+ { "px": [384,304], "src": [0,16], "f": 0, "t": 4, "d": [57,632], "a": 1 },
+ { "px": [336,352], "src": [0,16], "f": 0, "t": 4, "d": [57,725], "a": 1 },
+ { "px": [368,352], "src": [0,16], "f": 0, "t": 4, "d": [57,727], "a": 1 },
+ { "px": [176,32], "src": [0,32], "f": 0, "t": 8, "d": [56,75], "a": 1 },
+ { "px": [96,48], "src": [0,32], "f": 0, "t": 8, "d": [56,102], "a": 1 },
+ { "px": [128,48], "src": [0,32], "f": 0, "t": 8, "d": [56,104], "a": 1 },
+ { "px": [368,320], "src": [0,32], "f": 0, "t": 8, "d": [56,663], "a": 1 },
+ { "px": [320,448], "src": [0,32], "f": 0, "t": 8, "d": [56,916], "a": 1 },
+ { "px": [352,448], "src": [0,32], "f": 0, "t": 8, "d": [56,918], "a": 1 },
+ { "px": [384,448], "src": [0,32], "f": 0, "t": 8, "d": [56,920], "a": 1 },
+ { "px": [48,32], "src": [48,0], "f": 0, "t": 3, "d": [55,67], "a": 1 },
+ { "px": [192,48], "src": [48,0], "f": 0, "t": 3, "d": [55,108], "a": 1 },
+ { "px": [224,64], "src": [48,0], "f": 0, "t": 3, "d": [55,142], "a": 1 },
+ { "px": [432,64], "src": [48,0], "f": 0, "t": 3, "d": [55,155], "a": 1 },
+ { "px": [48,80], "src": [48,0], "f": 0, "t": 3, "d": [55,163], "a": 1 },
+ { "px": [112,80], "src": [48,0], "f": 0, "t": 3, "d": [55,167], "a": 1 },
+ { "px": [336,80], "src": [48,0], "f": 0, "t": 3, "d": [55,181], "a": 1 },
+ { "px": [352,80], "src": [48,0], "f": 0, "t": 3, "d": [55,182], "a": 1 },
+ { "px": [368,80], "src": [48,0], "f": 0, "t": 3, "d": [55,183], "a": 1 },
+ { "px": [224,96], "src": [48,0], "f": 0, "t": 3, "d": [55,206], "a": 1 },
+ { "px": [96,128], "src": [48,0], "f": 0, "t": 3, "d": [55,262], "a": 1 },
+ { "px": [432,176], "src": [48,0], "f": 0, "t": 3, "d": [55,379], "a": 1 },
+ { "px": [96,192], "src": [48,0], "f": 0, "t": 3, "d": [55,390], "a": 1 },
+ { "px": [384,208], "src": [48,0], "f": 0, "t": 3, "d": [55,440], "a": 1 },
+ { "px": [416,272], "src": [48,0], "f": 0, "t": 3, "d": [55,570], "a": 1 },
+ { "px": [432,272], "src": [48,0], "f": 0, "t": 3, "d": [55,571], "a": 1 },
+ { "px": [272,288], "src": [48,0], "f": 0, "t": 3, "d": [55,593], "a": 1 },
+ { "px": [288,288], "src": [48,0], "f": 0, "t": 3, "d": [55,594], "a": 1 },
+ { "px": [336,464], "src": [48,0], "f": 0, "t": 3, "d": [55,949], "a": 1 },
+ { "px": [368,464], "src": [48,0], "f": 0, "t": 3, "d": [55,951], "a": 1 },
+ { "px": [64,32], "src": [16,0], "f": 0, "t": 1, "d": [54,68], "a": 1 },
+ { "px": [64,80], "src": [16,0], "f": 0, "t": 1, "d": [54,164], "a": 1 },
+ { "px": [240,96], "src": [16,0], "f": 0, "t": 1, "d": [54,207], "a": 1 },
+ { "px": [304,384], "src": [16,0], "f": 0, "t": 1, "d": [54,787], "a": 1 },
+ { "px": [224,32], "src": [32,0], "f": 0, "t": 2, "d": [53,78], "a": 1 },
+ { "px": [160,48], "src": [32,0], "f": 0, "t": 2, "d": [53,106], "a": 1 },
+ { "px": [80,128], "src": [32,0], "f": 0, "t": 2, "d": [53,261], "a": 1 },
+ { "px": [96,160], "src": [32,0], "f": 0, "t": 2, "d": [53,326], "a": 1 },
+ { "px": [80,192], "src": [32,0], "f": 0, "t": 2, "d": [53,389], "a": 1 },
+ { "px": [400,368], "src": [32,0], "f": 0, "t": 2, "d": [53,761], "a": 1 },
+ { "px": [32,80], "src": [32,16], "f": 0, "t": 6, "d": [52,162], "a": 1 },
+ { "px": [96,80], "src": [32,16], "f": 0, "t": 6, "d": [52,166], "a": 1 },
+ { "px": [448,80], "src": [32,16], "f": 0, "t": 6, "d": [52,188], "a": 1 },
+ { "px": [208,96], "src": [32,16], "f": 0, "t": 6, "d": [52,205], "a": 1 },
+ { "px": [304,144], "src": [32,16], "f": 0, "t": 6, "d": [52,307], "a": 1 },
+ { "px": [320,192], "src": [32,16], "f": 0, "t": 6, "d": [52,404], "a": 1 },
+ { "px": [336,208], "src": [32,16], "f": 0, "t": 6, "d": [52,437], "a": 1 },
+ { "px": [304,304], "src": [32,16], "f": 0, "t": 6, "d": [52,627], "a": 1 },
+ { "px": [320,320], "src": [32,16], "f": 0, "t": 6, "d": [52,660], "a": 1 },
+ { "px": [256,352], "src": [32,16], "f": 0, "t": 6, "d": [52,720], "a": 1 },
+ { "px": [272,368], "src": [32,16], "f": 0, "t": 6, "d": [52,753], "a": 1 },
+ { "px": [288,384], "src": [32,16], "f": 0, "t": 6, "d": [52,786], "a": 1 },
+ { "px": [320,464], "src": [32,16], "f": 0, "t": 6, "d": [52,948], "a": 1 },
+ { "px": [240,64], "src": [16,16], "f": 0, "t": 5, "d": [51,143], "a": 1 },
+ { "px": [128,80], "src": [16,16], "f": 0, "t": 5, "d": [51,168], "a": 1 },
+ { "px": [320,96], "src": [16,16], "f": 0, "t": 5, "d": [51,212], "a": 1 },
+ { "px": [416,96], "src": [16,16], "f": 0, "t": 5, "d": [51,218], "a": 1 },
+ { "px": [464,160], "src": [16,16], "f": 0, "t": 5, "d": [51,349], "a": 1 },
+ { "px": [448,176], "src": [16,16], "f": 0, "t": 5, "d": [51,380], "a": 1 },
+ { "px": [112,192], "src": [16,16], "f": 0, "t": 5, "d": [51,391], "a": 1 },
+ { "px": [416,192], "src": [16,16], "f": 0, "t": 5, "d": [51,410], "a": 1 },
+ { "px": [400,208], "src": [16,16], "f": 0, "t": 5, "d": [51,441], "a": 1 },
+ { "px": [400,288], "src": [16,16], "f": 0, "t": 5, "d": [51,601], "a": 1 },
+ { "px": [448,320], "src": [16,16], "f": 0, "t": 5, "d": [51,668], "a": 1 },
+ { "px": [432,352], "src": [16,16], "f": 0, "t": 5, "d": [51,731], "a": 1 },
+ { "px": [416,368], "src": [16,16], "f": 0, "t": 5, "d": [51,762], "a": 1 },
+ { "px": [384,464], "src": [16,16], "f": 0, "t": 5, "d": [51,952], "a": 1 },
+ { "px": [240,32], "src": [16,32], "f": 0, "t": 9, "d": [50,79], "a": 1 },
+ { "px": [208,48], "src": [16,32], "f": 0, "t": 9, "d": [50,109], "a": 1 },
+ { "px": [448,64], "src": [16,32], "f": 0, "t": 9, "d": [50,156], "a": 1 },
+ { "px": [384,80], "src": [16,32], "f": 0, "t": 9, "d": [50,184], "a": 1 },
+ { "px": [464,80], "src": [16,32], "f": 0, "t": 9, "d": [50,189], "a": 1 },
+ { "px": [112,128], "src": [16,32], "f": 0, "t": 9, "d": [50,263], "a": 1 },
+ { "px": [320,144], "src": [16,32], "f": 0, "t": 9, "d": [50,308], "a": 1 },
+ { "px": [336,192], "src": [16,32], "f": 0, "t": 9, "d": [50,405], "a": 1 },
+ { "px": [448,272], "src": [16,32], "f": 0, "t": 9, "d": [50,572], "a": 1 },
+ { "px": [304,288], "src": [16,32], "f": 0, "t": 9, "d": [50,595], "a": 1 },
+ { "px": [320,304], "src": [16,32], "f": 0, "t": 9, "d": [50,628], "a": 1 },
+ { "px": [336,320], "src": [16,32], "f": 0, "t": 9, "d": [50,661], "a": 1 },
+ { "px": [272,352], "src": [16,32], "f": 0, "t": 9, "d": [50,721], "a": 1 },
+ { "px": [288,368], "src": [16,32], "f": 0, "t": 9, "d": [50,754], "a": 1 },
+ { "px": [32,32], "src": [32,32], "f": 0, "t": 10, "d": [49,66], "a": 1 },
+ { "px": [416,64], "src": [32,32], "f": 0, "t": 10, "d": [49,154], "a": 1 },
+ { "px": [320,80], "src": [32,32], "f": 0, "t": 10, "d": [49,180], "a": 1 },
+ { "px": [304,96], "src": [32,32], "f": 0, "t": 10, "d": [49,211], "a": 1 },
+ { "px": [448,160], "src": [32,32], "f": 0, "t": 10, "d": [49,348], "a": 1 },
+ { "px": [416,176], "src": [32,32], "f": 0, "t": 10, "d": [49,378], "a": 1 },
+ { "px": [400,192], "src": [32,32], "f": 0, "t": 10, "d": [49,409], "a": 1 },
+ { "px": [400,272], "src": [32,32], "f": 0, "t": 10, "d": [49,569], "a": 1 },
+ { "px": [256,288], "src": [32,32], "f": 0, "t": 10, "d": [49,592], "a": 1 },
+ { "px": [384,288], "src": [32,32], "f": 0, "t": 10, "d": [49,600], "a": 1 },
+ { "px": [432,320], "src": [32,32], "f": 0, "t": 10, "d": [49,667], "a": 1 },
+ { "px": [416,352], "src": [32,32], "f": 0, "t": 10, "d": [49,730], "a": 1 },
+ { "px": [176,48], "src": [48,48], "f": 0, "t": 15, "d": [48,107], "a": 1 },
+ { "px": [48,144], "src": [0,0], "f": 0, "t": 0, "d": [47,291], "a": 1 },
+ { "px": [48,176], "src": [0,0], "f": 0, "t": 0, "d": [47,355], "a": 1 },
+ { "px": [336,416], "src": [0,0], "f": 0, "t": 0, "d": [47,853], "a": 1 },
+ { "px": [368,416], "src": [0,0], "f": 0, "t": 0, "d": [47,855], "a": 1 }
+ ],
+ "seed": 3670360,
+ "overrideTilesetUid": null,
+ "gridTiles": [],
+ "entityInstances": []
+ },
+ {
+ "__identifier": "AutoLayer_baked",
+ "__type": "Tiles",
+ "__cWid": 32,
+ "__cHei": 32,
+ "__gridSize": 16,
+ "__opacity": 1,
+ "__pxTotalOffsetX": 0,
+ "__pxTotalOffsetY": 0,
+ "__tilesetDefUid": 1,
+ "__tilesetRelPath": "../../sprites/bg/tree-tileset.png",
+ "iid": "7d6ed1e0-3740-11f0-9e9d-4f7e2d36af1d",
+ "levelId": 0,
+ "layerDefUid": 4,
+ "pxOffsetX": 0,
+ "pxOffsetY": 0,
+ "visible": true,
+ "optionalRules": [],
+ "intGridCsv": [],
+ "autoLayerTiles": [],
+ "seed": 1635543,
+ "overrideTilesetUid": null,
+ "gridTiles": [],
+ "entityInstances": []
+ },
+ {
+ "__identifier": "Things",
+ "__type": "IntGrid",
+ "__cWid": 32,
+ "__cHei": 32,
+ "__gridSize": 16,
+ "__opacity": 1,
+ "__pxTotalOffsetX": 0,
+ "__pxTotalOffsetY": 0,
+ "__tilesetDefUid": null,
+ "__tilesetRelPath": null,
+ "iid": "e8ed8c00-3740-11f0-9e9d-a3fe0fb66f38",
+ "levelId": 0,
+ "layerDefUid": 2,
+ "pxOffsetX": 0,
+ "pxOffsetY": 0,
+ "visible": true,
+ "optionalRules": [],
+ "intGridCsv": [
+ 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,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,1,
+ 1,1,1,1,1,2,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,2,1,2,
+ 1,2,2,2,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,2,1,2,1,1,2,
+ 1,2,2,2,1,1,1,1,1,1,1,1,1,1,2,2,2,1,1,1,1,1,2,2,2,1,2,2,2,1,1,2,1,2,1,
+ 1,1,1,1,1,2,2,2,2,2,1,2,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,1,1,
+ 1,2,2,1,1,1,2,2,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,
+ 1,1,1,2,2,1,1,1,2,1,1,1,1,1,1,1,2,2,2,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,
+ 2,1,1,1,1,2,1,1,1,1,1,2,1,1,1,2,1,1,1,2,2,1,2,2,1,1,1,2,2,1,1,1,1,1,1,
+ 1,1,2,1,1,1,1,1,1,1,1,2,2,1,1,1,2,2,2,2,2,1,1,1,1,2,1,1,1,1,1,1,1,2,2,
+ 1,1,1,1,1,2,1,1,1,2,1,1,1,2,2,2,2,2,1,1,1,1,2,1,1,1,1,1,2,2,2,1,1,1,1,
+ 1,1,1,1,2,2,2,1,1,1,1,2,2,2,1,1,1,1,1,2,2,1,1,1,2,2,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,2,2,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,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,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,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,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,
+ 2,1,1,1,1,2,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,2,2,1,
+ 1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,2,2,1,2,1,
+ 1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,2,1,2,1,1,1,2,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,2,1,2,1,1,2,2,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,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,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,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,1,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,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,1,2,1,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,2,2,2,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,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,1,1,1,1,1
+ ],
+ "autoLayerTiles": [],
+ "seed": 657921,
+ "overrideTilesetUid": null,
+ "gridTiles": [],
+ "entityInstances": []
+ }
+ ],
+ "__neighbours": []
+ }
+ ],
+ "worlds": [],
+ "dummyWorldIid": "a442a8b0-3740-11f0-9e9d-354f9776f167"
+} \ No newline at end of file
diff --git a/map/maps/test.map.gbasm b/map/maps/test.map.gbasm
new file mode 100644
index 0000000..9fce10d
--- /dev/null
+++ b/map/maps/test.map.gbasm
@@ -0,0 +1,10 @@
+; THIS FILE IS GENERATED AUTOMATICALLY, DO NOT CHANGE
+_map_Test:
+ .DB $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff, $37, $e3, $ff, $ff, $42, $bb
+ .DB $e3, $ff, $16, $bb, $ca, $0f, $d6, $23, $d8, $e7, $1f, $ff, $dc, $f7, $ff, $ff
+ .DB $de, $f7, $ff, $1f, $df, $e7, $27, $77, $cf, $ef, $07, $3f, $e3, $ef, $07, $77
+ .DB $f9, $cf, $8f, $1f, $fc, $1f, $df, $ff, $ff, $3f, $ff, $ff, $ff, $bf, $ff, $ff
+ .DB $ff, $ff, $ff, $ff, $e1, $ff, $ff, $ff, $ec, $f0, $ff, $ff, $ee, $e6, $ff, $ff
+ .DB $e7, $4e, $ff, $ff, $f7, $5e, $ff, $ff, $f3, $5c, $ff, $ff, $f9, $f9, $ff, $ff
+ .DB $ff, $f3, $ff, $ff, $ff, $ff, $ff, $ff, $ff, $5f, $ff, $ff, $ff, $ff, $ff, $ff
+ .DB $fe, $af, $ff, $ff, $fe, $0f, $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
diff --git a/map/utils.gbasm b/map/utils.gbasm
index cf2c4ce..64b2de7 100644
--- a/map/utils.gbasm
+++ b/map/utils.gbasm
@@ -27,3 +27,44 @@ Pick_Random_Room_Avoid_A: ; input A = room to avoid (or FF if none), output A =
POP BC
RET
+Pick_Room_Position_Avoid_A:; input A = room to avoid (or FF if none), output BC = XY position
+ CALL =Pick_Random_Room_Avoid_A
+Pick_Room_position: ; input A = room to spawn in, output BC = XY position
+ PUSH HL
+ PUSH DE
+ SLA A
+ SLA A
+ ADD low($mem_room_list)
+ LD C, A
+
+ LD B, high($mem_room_list)
+
+ ; X
+ LD A, (BC)
+ LD D, A
+ INC BC
+ LD A, (BC)
+ INC A
+ CALL =RNG_Bound
+ ADD D
+
+ LD H, A
+
+ INC BC
+
+ ; Y
+ LD A, (BC)
+ LD D, A
+ INC BC
+ LD A, (BC)
+ INC A
+ CALL =RNG_Bound
+ ADD D
+ LD L, A
+
+ LD B, H
+ LD C, L
+
+ POP DE
+ POP HL
+ RET
diff --git a/modes/dungeongeneration.gbasm b/modes/dungeongeneration.gbasm
index 8c62081..c459805 100644
--- a/modes/dungeongeneration.gbasm
+++ b/modes/dungeongeneration.gbasm
@@ -145,10 +145,10 @@ Dungeon_generation_VBlank:
.RESET_INTERRUPTS
EI
- Wait_for_Interrupt.loop:
+ .Wait_for_Interrupt.loop:
LD A, $reg_lcd_status
HALT
- JP =Wait_for_Interrupt.loop
+ JP =.Wait_for_Interrupt.loop
Dungeon_generation_Out_Of_VBlank:
PUSH AF
diff --git a/modes/maploading.gbasm b/modes/maploading.gbasm
new file mode 100644
index 0000000..d96bca0
--- /dev/null
+++ b/modes/maploading.gbasm
@@ -0,0 +1,172 @@
+; VBlank: Write loading text, then wait for generation, then loading vram stuff
+; When VBlank interrupts -> context switch
+; When stat out of vblank interrupt -> context switch back to generation
+
+.MACRODEF ENABLE_MODE_2_INTERRUPT
+ LD A, low(=Map_Loading_Out_Of_VBlank)
+ LD ($mem_stat_jump_destination), A
+ LD A, high(=Map_Loading_Out_Of_VBlank)
+ LD ($mem_stat_jump_destination+1), A
+ .RESET_INTERRUPTS
+ LD A, $20
+ LD $reg_lcd_status, A
+ LD A, $02
+ LD $reg_interrupt_enable, A
+.END
+
+.MACRODEF DISABLE_MODE_2_INTERRUPT
+ LD A, $00
+ LD $reg_lcd_status, A
+ LD A, $00
+ LD $reg_interrupt_enable, A
+.END
+
+Map_Loading:
+ LD SP, $fffe
+
+ LD A, $00
+ LD $reg_viewport_x, A
+ LD A, $68
+ LD $reg_viewport_y, A
+
+ LD A, $00
+ LD $mem_display_flag, A
+
+ LD HL, =Dungeon
+ CALL =Load_Dungeon_Txt
+
+ LD A, $f4
+ LD ($9ecb), A
+
+ LD HL, $9ec9
+ LD A, $mem_floor_count
+ CALL =Print_8bit
+
+ LD A, $07
+ LD $reg_bg_palette, A
+
+ LD A, $lcdc_guibg_tilemap
+ LD $reg_lcd_controller, A
+
+ CALL =Reset_Map
+
+ LD HL, $mem_dungeon_map
+ LD BC, $0080
+ LD DE, =_map_Test
+ CALL =memcpy
+
+ LD HL, =Dungeon
+ CALL =Load_Dungeon_Spawn_patterns
+ LD A, $entity_questgoalbunny_index
+ LD $mem_loaded_special_entity_index, A
+
+ CALL =Reload_EP_Cost
+ LD B, $0f
+ LD C, $0f
+ CALL =Initialize_Bunny
+ CALL =Reset_viewport_thingies
+
+ LD A, $mem_map_loading_flags
+ OR $01
+ LD $mem_map_loading_flags, A
+
+ LD HL, $mem_object_list
+ LD BC, $0080
+ CALL =bff
+
+ ; Reset animations
+ LD HL, $mem_animation_list
+ LD BC, $1f
+ CALL =bzero
+
+ ; Clear OAM buffer
+ LD HL, $mem_oam_buffer
+ LD BC, $00a0
+ CALL =bzero
+
+ LD A, $00
+ LD $mem_display_flag, A
+ LD $mem_moving_animation_step, A
+ LD $mem_animation_wait_frames, A
+ LD $mem_blinking_animation_counter, A
+
+ LD A, $mem_bunny_x
+ LD $mem_bunny_predicted_x, A
+ LD A, $mem_bunny_y
+ LD $mem_bunny_predicted_y, A
+
+ LD A, $mem_map_loading_flags
+ RES 3, A
+ LD $mem_map_loading_flags, A
+
+ LD A, $enum_dungeon_mode
+ LD $mem_current_mode, A
+ LD $mem_requested_mode, A
+
+ LD A, $00
+ LD $mem_oam_buffer_low, A
+ CALL =Display_Entities
+
+ CALL =Generation_Event_Execution
+
+ CALL =Load_Prepared_Map
+
+ CALL =VBlank_Wait
+
+Map_Loading_VBlank:
+ .ENABLE_MODE_2_INTERRUPT
+ EI
+
+ ; Heart
+ LD A, $f0
+ LD ($9d62), A
+
+ ; Energy points
+ LD A, $f1
+ LD ($9d66), A
+
+ ; Floor
+ LD A, $f4
+ LD ($9d73), A
+
+ LD B, B
+ CALL =Reload_Entities_Tile_Data
+ LD B, B
+ ; Clear OAM
+ LD HL, $fe00
+ LD BC, $00a0
+ CALL =bzero
+
+ LD DE, $mem_map_loading_buffer
+ LD HL, $9800
+ LD BC, $0400
+ CALL =memcpy
+ CALL =Load_Objects
+
+ LD HL, $9d71
+ LD A, $mem_floor_count
+ CALL =Print_8bit
+
+ CALL =Update_VBlank_Handler
+
+ DI
+ .DISABLE_MODE_2_INTERRUPT
+
+ CALL =Reset_Entities_Collision_Map
+
+ .ENABLE_VBLANK_INTERRUPTS
+ .RESET_INTERRUPTS
+ EI
+
+ .Wait_for_Interrupt.loop:
+ LD A, $reg_lcd_status
+ HALT
+ JP =.Wait_for_Interrupt.loop
+
+Map_Loading_Out_Of_VBlank:
+ PUSH AF
+ CALL =VBlank_Wait
+ .ENABLE_MODE_2_INTERRUPT
+ .RESET_INTERRUPTS
+ POP AF
+ RETI
diff --git a/modes/vblank_handler_list.gbasm b/modes/vblank_handler_list.gbasm
index 768147f..99db063 100644
--- a/modes/vblank_handler_list.gbasm
+++ b/modes/vblank_handler_list.gbasm
@@ -29,7 +29,11 @@ VBlank_Handler_List:
; 3 (new dungeon)
.DB =New_Dungeon
+ ; 4 (pregenerated map loading)
+ .DB =Map_Loading
+
.INCLUDE "modes/dialoguemenu.gbasm"
.INCLUDE "modes/dungeon.gbasm"
.INCLUDE "modes/loading.gbasm"
.INCLUDE "modes/dungeongeneration.gbasm"
+.INCLUDE "modes/maploading.gbasm"
diff --git a/scripts/parse-ldtkmap.py b/scripts/parse-ldtkmap.py
new file mode 100644
index 0000000..5071515
--- /dev/null
+++ b/scripts/parse-ldtkmap.py
@@ -0,0 +1,33 @@
+import json
+import sys
+import os
+
+filename = sys.argv[1]
+
+label = "_map_" + os.path.basename(filename)[:-5].replace(".", " ").title().replace(" ", "_")
+
+print(label+":")
+file = open(filename, "r")
+
+ldtk = json.loads(file.read())
+
+intgridLayer = [i for i in ldtk['levels'][0]['layerInstances'] if i['__type'] == 'IntGrid'][0]['intGridCsv']
+autoLayer = [i for i in ldtk['levels'][0]['layerInstances'] if i['__type'] == 'AutoLayer'][0]['autoLayerTiles']
+
+collision_map = []
+for y in range(0, 32):
+ for x in range(0,4):
+ collision_u8 = 0
+ for i in range(0,8):
+ if intgridLayer[y*32+(31-(x*8+i))] == 2:
+ collision_u8 |= 1 << (7-i)
+ collision_map.append(collision_u8 ^ 0xff)
+
+for i in range(0, int(len(collision_map) / 16)):
+ print("\t.DB ", end="")
+ for j in range(0, 15):
+ print("${:02x}, ".format(collision_map[i*16+j]), end="")
+ print("${:02x}".format(collision_map[i*16+15]))
+
+# print("============================")
+# print(autoLayer)
diff --git a/tileset.gbasm b/tileset.gbasm
index 18c1a74..f53d297 100644
--- a/tileset.gbasm
+++ b/tileset.gbasm
@@ -1,3 +1,4 @@
+; THIS FILE IS GENERATED AUTOMATICALLY, DO NOT CHANGE
GUI_Border_Data:
.DB $ff, $00, $ff, $ff, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 0x10
.DB $00, $00, $1f, $1f, $3f, $20, $70, $40, $60, $40, $60, $40, $60, $40, $60, $40 ; 0x11