diff options
| author | iamcheeseman <[hidden email]> | 2026-01-15 20:23:41 -0500 |
|---|---|---|
| committer | iamcheeseman <[hidden email]> | 2026-01-15 20:23:41 -0500 |
| commit | c353e0b095fb724ee50d6e09fb00cc82b51da250 (patch) | |
| tree | 060f11a1e09352e3191b0fc1ad7970abc8b7e3a0 | |
| parent | 012a78995d9e360de1d931943b34f21d4f4a85af (diff) | |
unlockable abilities
| -rw-r--r-- | res/img/dash_pickup.qoi | bin | 0 -> 78 bytes | |||
| -rw-r--r-- | res/img/double_jump_pickup.qoi | bin | 0 -> 109 bytes | |||
| -rw-r--r-- | res/rooms.world | 7 | ||||
| -rw-r--r-- | res/rooms/carrabassett0.tmj | 4 | ||||
| -rw-r--r-- | res/rooms/carrabassett1.tmj | 39 | ||||
| -rw-r--r-- | res/rooms/carrabassett3.tmj | 8 | ||||
| -rw-r--r-- | res/rooms/carrabassett4.tmj | 86 | ||||
| -rw-r--r-- | res/world.tiled-project | 11 | ||||
| -rw-r--r-- | src/assets.odin | 39 | ||||
| -rw-r--r-- | src/frame_callbacks.odin | 16 | ||||
| -rw-r--r-- | src/main.odin | 11 | ||||
| -rw-r--r-- | src/player.odin | 21 | ||||
| -rw-r--r-- | src/resources.odin | 9 | ||||
| -rw-r--r-- | src/upgrade_pickup.odin | 76 | ||||
| -rw-r--r-- | src/world.odin | 1 | ||||
| -rw-r--r-- | tools/compile_assets/main.odin | 18 | ||||
| -rw-r--r-- | tools/compile_assets/tiled.odin | 26 |
17 files changed, 325 insertions, 47 deletions
diff --git a/res/img/dash_pickup.qoi b/res/img/dash_pickup.qoi Binary files differnew file mode 100644 index 0000000..e31a9b7 --- /dev/null +++ b/res/img/dash_pickup.qoi diff --git a/res/img/double_jump_pickup.qoi b/res/img/double_jump_pickup.qoi Binary files differnew file mode 100644 index 0000000..8abdebd --- /dev/null +++ b/res/img/double_jump_pickup.qoi diff --git a/res/rooms.world b/res/rooms.world index a237ae4..9bec206 100644 --- a/res/rooms.world +++ b/res/rooms.world @@ -27,6 +27,13 @@ "width": 320, "x": 947, "y": -348 + }, + { + "fileName": "rooms/carrabassett4.tmj", + "height": 320, + "width": 320, + "x": 1267, + "y": -140 } ], "onlyShowAdjacentMaps": false, diff --git a/res/rooms/carrabassett0.tmj b/res/rooms/carrabassett0.tmj index e7d44ce..1987ad9 100644 --- a/res/rooms/carrabassett0.tmj +++ b/res/rooms/carrabassett0.tmj @@ -8,8 +8,8 @@ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 27, 31, 31, 19, 19, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 21, 31, 31, 31, 11, 0, 0, 0, 0, 16, 19, 31, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 27, 31, 19, 31, 19, 19, 19, 31, 19, 31, 19, 19, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 28, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 21, 31, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 21, 31, 19, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 31, 31, 31, 19, 19, 31, + 40, 40, 40, 40, 21, 31, 31, 31, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 31, 31, 31, 19, 19, 31, 40, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 18, 9, 9, 20, 9, 9, diff --git a/res/rooms/carrabassett1.tmj b/res/rooms/carrabassett1.tmj index 5a59827..91274b9 100644 --- a/res/rooms/carrabassett1.tmj +++ b/res/rooms/carrabassett1.tmj @@ -32,9 +32,44 @@ "width":20, "x":0, "y":0 + }, + { + "draworder":"topdown", + "id":2, + "name":"Objects", + "objects":[ + { + "height":0, + "id":1, + "name":"Dash", + "point":true, + "properties":[ + { + "name":"image", + "type":"file", + "value":"..\/img\/dash_pickup.qoi" + }, + { + "name":"type", + "propertytype":"UpgradeType", + "type":"int", + "value":0 + }], + "rotation":0, + "type":"upgrade", + "visible":true, + "width":0, + "x":160, + "y":240 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 }], - "nextlayerid":2, - "nextobjectid":1, + "nextlayerid":3, + "nextobjectid":7, "orientation":"orthogonal", "renderorder":"right-down", "tiledversion":"1.11.2", diff --git a/res/rooms/carrabassett3.tmj b/res/rooms/carrabassett3.tmj index 7c5983d..ed79838 100644 --- a/res/rooms/carrabassett3.tmj +++ b/res/rooms/carrabassett3.tmj @@ -31,10 +31,10 @@ 40, 40, 38, 42, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 38, 20, 20, 42, 0, 10, 19, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 27, 19, 19, 28, 40, 8, 0, 0, 0, 10, 31, 19, 31, 28, 40, 40, 40, 40, 40, - 40, 32, 0, 0, 10, 19, 17, 0, 0, 0, 0, 0, 0, 0, 16, 31, 31, 31, 28, 40, - 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, - 40, 38, 9, 9, 9, 20, 20, 18, 18, 9, 9, 42, 0, 0, 0, 0, 0, 0, 7, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 8, 0, 0, 5, 20, 20, 9, 39, 40, + 40, 32, 0, 0, 10, 19, 17, 0, 0, 0, 0, 0, 0, 0, 16, 31, 31, 31, 19, 31, + 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 40, 38, 9, 9, 9, 20, 20, 18, 18, 9, 9, 42, 0, 0, 0, 0, 0, 0, 0, 0, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 8, 0, 0, 5, 20, 20, 9, 9, 18, 40, 40, 40, 21, 31, 31, 19, 31, 31, 19, 19, 17, 0, 5, 39, 40, 40, 40, 40, 40, 40, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 28, 40, 40, 40, 40, 40, 40, 27, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, diff --git a/res/rooms/carrabassett4.tmj b/res/rooms/carrabassett4.tmj new file mode 100644 index 0000000..acb18b1 --- /dev/null +++ b/res/rooms/carrabassett4.tmj @@ -0,0 +1,86 @@ +{ "compressionlevel":-1, + "height":20, + "infinite":false, + "layers":[ + { + "data":[40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 21, 31, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 21, 31, 19, 19, 17, 0, 10, 31, 19, 31, 28, 40, 40, 40, 40, 40, + 40, 40, 21, 31, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 19, 31, 19, 28, 40, + 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, + 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, + 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, + 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, + 27, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, + 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 39, 40, + 0, 0, 0, 0, 0, 0, 0, 0, 5, 18, 9, 20, 9, 20, 20, 9, 9, 39, 40, 40, + 18, 9, 20, 18, 20, 9, 9, 9, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40], + "height":20, + "id":1, + "name":"Tiles", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":20, + "x":0, + "y":0 + }, + { + "draworder":"topdown", + "id":2, + "name":"Objects", + "objects":[ + { + "height":0, + "id":1, + "name":"Double Jump", + "point":true, + "properties":[ + { + "name":"image", + "type":"file", + "value":"..\/img\/double_jump_pickup.qoi" + }, + { + "name":"type", + "propertytype":"UpgradeType", + "type":"int", + "value":1 + }], + "rotation":0, + "type":"upgrade", + "visible":true, + "width":0, + "x":160, + "y":241 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 + }], + "nextlayerid":3, + "nextobjectid":3, + "orientation":"orthogonal", + "renderorder":"right-down", + "tiledversion":"1.11.2", + "tileheight":16, + "tilesets":[ + { + "firstgid":1, + "source":"..\/tileset.tsj" + }], + "tilewidth":16, + "type":"map", + "version":"1.10", + "width":20 +}
\ No newline at end of file diff --git a/res/world.tiled-project b/res/world.tiled-project index d0eb592..d895c5d 100644 --- a/res/world.tiled-project +++ b/res/world.tiled-project @@ -10,5 +10,16 @@ "properties": [ ], "propertyTypes": [ + { + "id": 1, + "name": "UpgradeType", + "storageType": "int", + "type": "enum", + "values": [ + "dash", + "double_jump" + ], + "valuesAsFlags": false + } ] } diff --git a/src/assets.odin b/src/assets.odin index b1d6448..3a3f64c 100644 --- a/src/assets.odin +++ b/src/assets.odin @@ -8,6 +8,8 @@ package demonchime Image_Id :: enum { BULLET, + DASH_PICKUP, + DOUBLE_JUMP_PICKUP, PISTOL, PLAYER, TILESETS, @@ -23,6 +25,7 @@ Room_Id :: enum { CARRABASSETT1, CARRABASSETT2, CARRABASSETT3, + CARRABASSETT4, } Tileset_Id :: enum { @@ -32,17 +35,13 @@ Tileset_Id :: enum { Object_Type :: enum { COLLISION, PLAYER_SPAWN, -} - -Resource_Id :: union { - Image_Id, - Animation_Id, - Room_Id, - Tileset_Id, + UPGRADE, } images: [Image_Id]Image_Resource = { .BULLET = {data = #load("../res/img/bullet.qoi"), anim = .NONE}, + .DASH_PICKUP = {data = #load("../res/img/dash_pickup.qoi"), anim = .NONE}, + .DOUBLE_JUMP_PICKUP = {data = #load("../res/img/double_jump_pickup.qoi"), anim = .NONE}, .PISTOL = {data = #load("../res/img/pistol.qoi"), anim = .NONE}, .PLAYER = {data = #load("../.compiled-res/player-sheet.qoi"), anim = .PLAYER}, .TILESETS = {data = #load("../.compiled-res/tilesets.qoi"), anim = .NONE}, @@ -50,14 +49,15 @@ images: [Image_Id]Image_Resource = { animations: [Animation_Id]Animation_Resource = { .NONE = {frame_count=1, frame_durations={100}, tags={}}, - .PLAYER = {frame_count = 23, frame_durations = {100, 100, 100, 100, 100, 100, 75, 75, 75, 75, 75, 75, 75, 75, 100, 100, 100, 100, 100, 100, 100, 100, 100}, tags = {"idle"={from = 0, to = 5}, "jump_trans"={from = 16, to = 16}, "run"={from = 6, to = 13}, "jump_down"={from = 17, to = 18}, "jump_up"={from = 14, to = 15}, "sleep"={from = 19, to = 22}}}, + .PLAYER = {frame_count = 23, frame_durations = {100, 100, 100, 100, 100, 100, 75, 75, 75, 75, 75, 75, 75, 75, 100, 100, 100, 100, 100, 100, 100, 100, 100}, tags = {"jump_up"={from = 14, to = 15}, "run"={from = 6, to = 13}, "jump_trans"={from = 16, to = 16}, "jump_down"={from = 17, to = 18}, "idle"={from = 0, to = 5}, "sleep"={from = 19, to = 22}}}, } rooms: [Room_Id]Room_Resource = { - .CARRABASSETT0 = {width=40, height=20, tile_width=16, tile_height=16, layers={{40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 27, 31, 31, 19, 19, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 21, 31, 31, 31, 11, 0, 0, 0, 0, 16, 19, 31, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 27, 31, 19, 31, 19, 19, 19, 31, 19, 31, 19, 19, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 21, 31, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 21, 31, 19, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 31, 31, 31, 19, 19, 31, 40, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 18, 9, 9, 20, 9, 9, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 41, 9, 20, 20, 20, 18, 20, 20, 9, 20, 9, 20, 9, 20, 20, 9, 9, 18, 6, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 27, 17, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 17, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 43, 9, 9, 20, 20, 9, 39, 40, 40, 40, 40, 40, 40, 0, 0, 0, 0, 0, 5, 20, 20, 18, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 20, 9, 20, 18, 20, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40}}, objects={{type = .PLAYER_SPAWN, pos = {240, 184}, size = {0, 0}, parallax = {0, 0}, properties = {}}, {type = .COLLISION, pos = {0, 0}, size = {48, 48}, parallax = {0, 0}, properties = {}}, }, background_image=nil}, - .CARRABASSETT1 = {width=20, height=20, tile_width=16, tile_height=16, layers={{40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 21, 31, 31, 31, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 27, 31, 31, 17, 0, 0, 0, 16, 19, 28, 40, 40, 40, 40, 40, 40, 40, 27, 31, 31, 17, 0, 0, 0, 0, 0, 0, 0, 0, 16, 28, 40, 40, 40, 40, 40, 27, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 28, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 28, 40, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 38, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 28, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 40, 43, 9, 9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 18, 20, 20, 40, 40, 40, 40, 40, 43, 9, 9, 9, 9, 9, 9, 18, 9, 18, 18, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40}}, objects={}, background_image=nil}, + .CARRABASSETT0 = {width=40, height=20, tile_width=16, tile_height=16, layers={{40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 27, 31, 31, 19, 19, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 21, 31, 31, 31, 11, 0, 0, 0, 0, 16, 19, 31, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 27, 31, 19, 31, 19, 19, 19, 31, 19, 31, 19, 19, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 21, 31, 31, 31, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 31, 31, 31, 19, 19, 31, 40, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 18, 9, 9, 20, 9, 9, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 41, 9, 20, 20, 20, 18, 20, 20, 9, 20, 9, 20, 9, 20, 20, 9, 9, 18, 6, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 27, 17, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 17, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 43, 9, 9, 20, 20, 9, 39, 40, 40, 40, 40, 40, 40, 0, 0, 0, 0, 0, 5, 20, 20, 18, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 20, 9, 20, 18, 20, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40}}, objects={{type = .PLAYER_SPAWN, pos = {240, 184}, size = {0, 0}, parallax = {0, 0}, properties = {}}, {type = .COLLISION, pos = {0, 0}, size = {48, 48}, parallax = {0, 0}, properties = {}}, }, background_image=nil}, + .CARRABASSETT1 = {width=20, height=20, tile_width=16, tile_height=16, layers={{40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 21, 31, 31, 31, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 27, 31, 31, 17, 0, 0, 0, 16, 19, 28, 40, 40, 40, 40, 40, 40, 40, 27, 31, 31, 17, 0, 0, 0, 0, 0, 0, 0, 0, 16, 28, 40, 40, 40, 40, 40, 27, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 28, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 28, 40, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 38, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 28, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 40, 43, 9, 9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 18, 20, 20, 40, 40, 40, 40, 40, 43, 9, 9, 9, 9, 9, 9, 18, 9, 18, 18, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40}}, objects={{type = .UPGRADE, pos = {160, 240}, size = {0, 0}, parallax = {0, 0}, properties = {"type"=0, "image"="res/img/dash_pickup.qoi"}}, }, background_image=nil}, .CARRABASSETT2 = {width=20, height=20, tile_width=16, tile_height=16, layers={{40, 40, 40, 8, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 8, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 8, 0, 0, 10, 31, 31, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 38, 20, 42, 0, 0, 0, 10, 19, 19, 28, 40, 40, 40, 40, 40, 40, 40, 40, 27, 31, 19, 28, 38, 18, 6, 0, 0, 0, 0, 10, 19, 28, 40, 40, 40, 40, 40, 27, 17, 0, 0, 10, 28, 40, 38, 20, 42, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 17, 0, 0, 0, 0, 16, 19, 31, 19, 17, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 39, 40, 40, 40, 40, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 18, 9, 9, 39, 40, 40, 40, 40, 40, 40, 20, 9, 18, 9, 9, 9, 20, 20, 9, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40}}, objects={}, background_image=nil}, - .CARRABASSETT3 = {width=20, height=40, tile_width=16, tile_height=16, layers={{40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 27, 19, 31, 19, 19, 31, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 21, 19, 31, 17, 0, 0, 0, 0, 0, 16, 19, 28, 40, 40, 40, 40, 40, 40, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 19, 28, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 27, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 28, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 20, 9, 39, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 18, 9, 18, 39, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 41, 20, 20, 18, 18, 39, 40, 40, 40, 40, 40, 21, 28, 40, 40, 32, 0, 0, 0, 0, 10, 31, 31, 19, 19, 28, 40, 40, 40, 40, 27, 17, 7, 40, 40, 43, 42, 0, 0, 0, 0, 0, 0, 0, 0, 10, 19, 19, 19, 31, 17, 0, 7, 40, 40, 40, 38, 18, 18, 20, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 38, 20, 20, 18, 6, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 38, 6, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 43, 6, 0, 0, 0, 0, 0, 7, 40, 40, 21, 28, 40, 21, 31, 28, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 7, 40, 40, 32, 16, 19, 17, 0, 16, 19, 19, 31, 28, 40, 38, 9, 20, 6, 0, 0, 7, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 16, 19, 31, 19, 19, 17, 0, 0, 7, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 20, 18, 9, 9, 18, 20, 39, 40, 40, 43, 6, 0, 0, 0, 0, 0, 41, 20, 20, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 38, 42, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 38, 20, 20, 42, 0, 10, 19, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 27, 19, 19, 28, 40, 8, 0, 0, 0, 10, 31, 19, 31, 28, 40, 40, 40, 40, 40, 40, 32, 0, 0, 10, 19, 17, 0, 0, 0, 0, 0, 0, 0, 16, 31, 31, 31, 28, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 38, 9, 9, 9, 20, 20, 18, 18, 9, 9, 42, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 8, 0, 0, 5, 20, 20, 9, 39, 40, 40, 40, 40, 21, 31, 31, 19, 31, 31, 19, 19, 17, 0, 5, 39, 40, 40, 40, 40, 40, 40, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 28, 40, 40, 40, 40, 40, 40, 27, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 41, 20, 18, 20, 39, 40, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 38, 6, 0, 0, 0, 0, 41, 9, 9, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 43, 6, 0, 0, 41, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40}}, objects={}, background_image=nil}, + .CARRABASSETT3 = {width=20, height=40, tile_width=16, tile_height=16, layers={{40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 27, 19, 31, 19, 19, 31, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 21, 19, 31, 17, 0, 0, 0, 0, 0, 16, 19, 28, 40, 40, 40, 40, 40, 40, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 19, 28, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 27, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 28, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 20, 9, 39, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 18, 9, 18, 39, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 41, 20, 20, 18, 18, 39, 40, 40, 40, 40, 40, 21, 28, 40, 40, 32, 0, 0, 0, 0, 10, 31, 31, 19, 19, 28, 40, 40, 40, 40, 27, 17, 7, 40, 40, 43, 42, 0, 0, 0, 0, 0, 0, 0, 0, 10, 19, 19, 19, 31, 17, 0, 7, 40, 40, 40, 38, 18, 18, 20, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 38, 20, 20, 18, 6, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 38, 6, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 43, 6, 0, 0, 0, 0, 0, 7, 40, 40, 21, 28, 40, 21, 31, 28, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 7, 40, 40, 32, 16, 19, 17, 0, 16, 19, 19, 31, 28, 40, 38, 9, 20, 6, 0, 0, 7, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 16, 19, 31, 19, 19, 17, 0, 0, 7, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 20, 18, 9, 9, 18, 20, 39, 40, 40, 43, 6, 0, 0, 0, 0, 0, 41, 20, 20, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 38, 42, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 38, 20, 20, 42, 0, 10, 19, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 27, 19, 19, 28, 40, 8, 0, 0, 0, 10, 31, 19, 31, 28, 40, 40, 40, 40, 40, 40, 32, 0, 0, 10, 19, 17, 0, 0, 0, 0, 0, 0, 0, 16, 31, 31, 31, 19, 31, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 38, 9, 9, 9, 20, 20, 18, 18, 9, 9, 42, 0, 0, 0, 0, 0, 0, 0, 0, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 8, 0, 0, 5, 20, 20, 9, 9, 18, 40, 40, 40, 21, 31, 31, 19, 31, 31, 19, 19, 17, 0, 5, 39, 40, 40, 40, 40, 40, 40, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 28, 40, 40, 40, 40, 40, 40, 27, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 41, 20, 18, 20, 39, 40, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 38, 6, 0, 0, 0, 0, 41, 9, 9, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 43, 6, 0, 0, 41, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40}}, objects={}, background_image=nil}, + .CARRABASSETT4 = {width=20, height=20, tile_width=16, tile_height=16, layers={{40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 21, 31, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 21, 31, 19, 19, 17, 0, 10, 31, 19, 31, 28, 40, 40, 40, 40, 40, 40, 40, 21, 31, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 19, 31, 19, 28, 40, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 21, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 27, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 39, 40, 0, 0, 0, 0, 0, 0, 0, 0, 5, 18, 9, 20, 9, 20, 20, 9, 9, 39, 40, 40, 18, 9, 20, 18, 20, 9, 9, 9, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40}}, objects={{type = .UPGRADE, pos = {160, 241}, size = {0, 0}, parallax = {0, 0}, properties = {"image"="res/img/double_jump_pickup.qoi", "type"=1}}, }, background_image=nil}, } tilesets: [Tileset_Id]Tileset_Resource = { @@ -160,19 +160,26 @@ world: []Room_Position_Resource = { {id=.CARRABASSETT1, x=-13, y=292, width=320, height=320}, {id=.CARRABASSETT2, x=947, y=292, width=320, height=320}, {id=.CARRABASSETT3, x=947, y=-348, width=320, height=640}, + {id=.CARRABASSETT4, x=1267, y=-140, width=320, height=320}, } -path_to_id: map[string]Resource_Id = { +Resource_Id :: union { + Image_Id, + Animation_Id, + Room_Id, + Tileset_Id, +} + +path_to_resource_id: map[string]Resource_Id = { "res/rooms/carrabassett2.tmj" = Room_Id.CARRABASSETT2, + "res/rooms/carrabassett4.tmj" = Room_Id.CARRABASSETT4, "res/rooms/carrabassett0.tmj" = Room_Id.CARRABASSETT0, "res/rooms/carrabassett1.tmj" = Room_Id.CARRABASSETT1, "res/rooms/carrabassett3.tmj" = Room_Id.CARRABASSETT3, + "res/img/dash_pickup.qoi" = Image_Id.DASH_PICKUP, "res/img/player.ase" = Image_Id.PLAYER, "res/img/bullet.qoi" = Image_Id.BULLET, + "res/img/double_jump_pickup.qoi" = Image_Id.DOUBLE_JUMP_PICKUP, "res/img/pistol.qoi" = Image_Id.PISTOL, "res/img/tilesets.png" = Image_Id.TILESETS, } - -load_resources :: proc() { -} - diff --git a/src/frame_callbacks.odin b/src/frame_callbacks.odin new file mode 100644 index 0000000..c264da6 --- /dev/null +++ b/src/frame_callbacks.odin @@ -0,0 +1,16 @@ +package demonchime + +Update_Callback :: proc(f32) +Draw_Callback :: proc() + +update_callbacks := []Update_Callback{ + update_player, + update_bullets, + update_upgrade, +} + +draw_callbacks := []Draw_Callback{ + draw_player, + draw_bullets, + draw_upgrade, +} diff --git a/src/main.odin b/src/main.odin index 8bd1a77..05daf35 100644 --- a/src/main.odin +++ b/src/main.odin @@ -70,8 +70,9 @@ frame :: proc() { dt := rl.GetFrameTime() - update_player(dt) - update_bullets(dt) + for cb in update_callbacks { + cb(dt) + } state.camera.target = linalg.lerp( state.camera.target, @@ -92,9 +93,11 @@ frame :: proc() { }) renderer.tint = {1, 1, 1, 1} - draw_player() + for cb in draw_callbacks { + cb() + } + draw_room(current_room.id) - draw_bullets() rl.DrawRectangleGradientH( 0, diff --git a/src/player.odin b/src/player.odin index 2029195..debfd44 100644 --- a/src/player.odin +++ b/src/player.odin @@ -40,6 +40,9 @@ player: struct { state: Player_State, outside_room: bool, has_double_jumped: bool, + + owns_double_jump: bool, + owns_dash: bool, } init_player :: proc() { @@ -101,7 +104,9 @@ _default_state :: proc(dt: f32) { player.jump_buffer = PLAYER_JUMP_BUFFERING } - if is_keybind_just_down(actions.dash) && player.dash_cooldown <= 0 { + if player.owns_dash && + is_keybind_just_down(actions.dash) && + player.dash_cooldown <= 0 { _enter_dash() return } @@ -148,7 +153,7 @@ _default_state :: proc(dt: f32) { player.jump_buffer = 0 player.coyote_time = 0 - } else if !player.has_double_jumped { + } else if player.owns_double_jump && !player.has_double_jumped { vel.y = -PLAYER_DOUBLE_JUMP_FORCE player.has_double_jumped = true @@ -176,10 +181,14 @@ _default_state :: proc(dt: f32) { @(private = "file") _enter_dash :: proc() { - // the sprite x scale is the direction the player is facing :) + input := _get_input_dir() + if input == 0 { + // the sprite x scale is the direction the player is facing :) + input = math.sign(player.sprite.scale.x) + } phys.set_velocity( player.body, - {math.sign(player.sprite.scale.x) * PLAYER_DASH_SPEED, 0}, + {input * PLAYER_DASH_SPEED, 0}, ) player.dash_timer = PLAYER_DASH_TIME @@ -290,7 +299,9 @@ update_player :: proc(dt: f32) { draw_player :: proc() { draw_sprite(player.sprite) - draw_sprite(player.gun_sprite) + if player.state != .DASH { + draw_sprite(player.gun_sprite) + } } @(private = "file") diff --git a/src/resources.odin b/src/resources.odin index 537c265..7051fcf 100644 --- a/src/resources.odin +++ b/src/resources.odin @@ -4,6 +4,13 @@ import "core:log" import rl "vendor:raylib" +Tiled_Property :: union { + string, + i32, + f32, + bool, +} + Image_Resource :: struct { texture: rl.Texture2D, anim: Animation_Id, @@ -26,7 +33,7 @@ Object_Resource :: struct { pos: Vec2, size: Vec2, parallax: Vec2, - properties: map[string]any, + properties: map[string]Tiled_Property, } Room_Resource :: struct { diff --git a/src/upgrade_pickup.odin b/src/upgrade_pickup.odin new file mode 100644 index 0000000..e51190c --- /dev/null +++ b/src/upgrade_pickup.odin @@ -0,0 +1,76 @@ +package demonchime + +import "core:math/linalg" +import "core:log" + +import "phys" + +Upgrade_Type :: enum { + DASH = 0, + DOUBLE_JUMP, +} + +upgrade: struct { + active: bool, + image_id: Image_Id, + flag: ^bool, + pos: Vec2, +} + +update_upgrade :: proc(_: f32) { + player_pos := phys.get_position(player.body) + if linalg.length2(player_pos - upgrade.pos) > 16*16 { + return + } + + upgrade.flag^ = true + upgrade.active = false +} + +draw_upgrade :: proc() { + if !upgrade.active { + return + } + + draw_texture(get_image(upgrade.image_id), upgrade.pos) +} + +object_spawner_upgrade :: proc(obj: Object_Resource) { + type_name_int, has_type_name := obj.properties["type"].(i32) + + if has_type_name { + type_name := cast(Upgrade_Type)type_name_int + switch type_name { + case .DASH: + upgrade.flag = &player.owns_dash + case .DOUBLE_JUMP: + upgrade.flag = &player.owns_double_jump + case: + log.warnf("property 'type' is an invalid enum (%v) %v", type_name_int, type_name) + return + } + } else { + log.warnf("property 'type' must be a string") + return + } + + if upgrade.flag^ { + return + } + + upgrade.pos = obj.pos + + image_path, has_image_path := obj.properties["image"].(string) + if !has_image_path { + log.warnf("property 'image' must be a path or string") + return + } + image_id, has_image_id := path_to_resource_id[image_path].(Image_Id) + if !has_image_id { + log.warnf("property 'image' must point to an image resource") + return + } + upgrade.image_id = image_id + + upgrade.active = true +} diff --git a/src/world.odin b/src/world.odin index eca934c..2d996e9 100644 --- a/src/world.odin +++ b/src/world.odin @@ -12,6 +12,7 @@ current_room: Room_Position_Resource object_spawners := [Object_Type]Object_Spawner{ .PLAYER_SPAWN = object_spawner_player_spawn, .COLLISION = object_spawner_collision, + .UPGRADE = object_spawner_upgrade, } room_open_cb := []Room_Change_Callback{ diff --git a/tools/compile_assets/main.odin b/tools/compile_assets/main.odin index 01fdb3f..b82b5f3 100644 --- a/tools/compile_assets/main.odin +++ b/tools/compile_assets/main.odin @@ -35,13 +35,6 @@ Tileset_Id :: enum { Object_Type :: enum { <object-types>} -Resource_Id :: union { - Image_Id, - Animation_Id, - Room_Id, - Tileset_Id, -} - images: [Image_Id]Image_Resource = { <image-load>} @@ -60,12 +53,15 @@ tiles: []Tile_Resource = { world: []Room_Position_Resource = { <room-positions>} -path_to_id: map[string]Resource_Id = { -<resource-paths>} - -load_resources :: proc() { +Resource_Id :: union { + Image_Id, + Animation_Id, + Room_Id, + Tileset_Id, } +path_to_resource_id: map[string]Resource_Id = { +<resource-paths>} ` images: map[string]string diff --git a/tools/compile_assets/tiled.odin b/tools/compile_assets/tiled.odin index 29a6a69..621e988 100644 --- a/tools/compile_assets/tiled.odin +++ b/tools/compile_assets/tiled.odin @@ -452,6 +452,10 @@ load_json_room :: proc(path: string, file: ^os.File) { type_name := strings.to_screaming_snake_case(obj.type) // `object_type_names` now owns `type_name`; freed in main + if type_name in object_type_names { + key, _ := delete_key(&object_type_names, type_name) + delete(key) + } object_type_names[type_name] = {} pos := [2]f32{f32(obj.x), f32(obj.y)} @@ -465,9 +469,26 @@ load_json_room :: proc(path: string, file: ^os.File) { } defer delete(properties) + cwd, cwd_err := os.get_working_directory(context.temp_allocator) + assert(cwd_err == nil) + room_dir, room_dir_err := filepath.rel( + cwd, + filepath.dir(path, context.temp_allocator), + context.temp_allocator, + ) + assert(room_dir_err == nil) + for property in obj.properties { - fmt.println(property.name, property.value) - properties[property.name] = property.value + value := property.value + if strings.compare(property.type, "file") == 0 { + rel, err := filepath.join( + {room_dir, value.(string)}, + context.temp_allocator, + ) + assert(err == nil) + value = rel + } + properties[property.name] = value } line := fmt.tprintf( @@ -507,3 +528,4 @@ load_json_room :: proc(path: string, file: ^os.File) { ) rooms[filepath.stem(path)] = line } + |
