aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriamcheeseman <[hidden email]>2026-01-13 22:28:59 -0500
committeriamcheeseman <[hidden email]>2026-01-13 22:28:59 -0500
commit0bf86ef7b8f0ecad958f3fb592ceaf3d2f30336a (patch)
treeacc7ee1c60579b5547ee23e5311446d588075b20
parente5319f53de9f5f8ba4cb67e1302ebc3d7036135c (diff)
add support for tiled objects
-rw-r--r--res/map.world20
-rw-r--r--res/rooms.world27
-rw-r--r--res/rooms/room_begin.tmj (renamed from res/room_begin.tmj)29
-rw-r--r--res/rooms/room_begin_1.tmj (renamed from res/room_begin_1.tmj)26
-rw-r--r--res/rooms/room_begin_secret_1.tmj51
-rw-r--r--res/tileset.tsj6
-rw-r--r--res/world.tiled-session61
-rwxr-xr-xsrc.binbin5429024 -> 0 bytes
-rw-r--r--src/assets.odin80
-rw-r--r--src/main.odin3
-rw-r--r--src/player.odin12
-rw-r--r--src/resources.odin1
-rw-r--r--src/sprite.odin4
-rw-r--r--src/world.odin20
-rw-r--r--tools/compile_assets/main.odin31
-rw-r--r--tools/compile_assets/tiled.odin90
16 files changed, 362 insertions, 99 deletions
diff --git a/res/map.world b/res/map.world
deleted file mode 100644
index 8de5c1c..0000000
--- a/res/map.world
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "maps": [
- {
- "fileName": "room_begin_1.tmj",
- "height": 320,
- "width": 480,
- "x": -528,
- "y": -64
- },
- {
- "fileName": "room_begin.tmj",
- "height": 320,
- "width": 480,
- "x": -48,
- "y": -64
- }
- ],
- "onlyShowAdjacentMaps": false,
- "type": "world"
-}
diff --git a/res/rooms.world b/res/rooms.world
new file mode 100644
index 0000000..1be004f
--- /dev/null
+++ b/res/rooms.world
@@ -0,0 +1,27 @@
+{
+ "maps": [
+ {
+ "fileName": "rooms/room_begin.tmj",
+ "height": 320,
+ "width": 480,
+ "x": 307,
+ "y": 292
+ },
+ {
+ "fileName": "rooms/room_begin_1.tmj",
+ "height": 320,
+ "width": 480,
+ "x": -173,
+ "y": 292
+ },
+ {
+ "fileName": "rooms/room_begin_secret_1.tmj",
+ "height": 320,
+ "width": 480,
+ "x": 787,
+ "y": 292
+ }
+ ],
+ "onlyShowAdjacentMaps": false,
+ "type": "world"
+}
diff --git a/res/room_begin.tmj b/res/rooms/room_begin.tmj
index e483cc0..ca9ea36 100644
--- a/res/room_begin.tmj
+++ b/res/rooms/room_begin.tmj
@@ -32,9 +32,32 @@
"width":30,
"x":0,
"y":0
+ },
+ {
+ "draworder":"topdown",
+ "id":2,
+ "name":"Object Layer 1",
+ "objects":[
+ {
+ "height":0,
+ "id":1,
+ "name":"Player Spawn",
+ "point":true,
+ "rotation":0,
+ "type":"player_spawn",
+ "visible":true,
+ "width":0,
+ "x":240,
+ "y":149
+ }],
+ "opacity":1,
+ "type":"objectgroup",
+ "visible":true,
+ "x":0,
+ "y":0
}],
- "nextlayerid":2,
- "nextobjectid":1,
+ "nextlayerid":3,
+ "nextobjectid":2,
"orientation":"orthogonal",
"renderorder":"right-down",
"tiledversion":"1.11.2",
@@ -42,7 +65,7 @@
"tilesets":[
{
"firstgid":1,
- "source":"tileset.tsj"
+ "source":"..\/tileset.tsj"
}],
"tilewidth":16,
"type":"map",
diff --git a/res/room_begin_1.tmj b/res/rooms/room_begin_1.tmj
index 06f7afa..2f882a1 100644
--- a/res/room_begin_1.tmj
+++ b/res/rooms/room_begin_1.tmj
@@ -4,25 +4,25 @@
"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, 21, 19, 19, 19, 19, 31, 31, 28, 40,
- 40, 40, 40, 40, 40, 40, 27, 31, 19, 31, 31, 31, 19, 19, 31, 31, 31, 31, 19, 19, 19, 17, 0, 0, 0, 0, 0, 0, 10, 28,
- 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, 20, 20, 20, 18, 9, 18, 9, 18, 18, 9, 39, 40, 40, 40, 40, 40, 40, 40, 40,
- 43, 20, 20, 9, 20, 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, 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,
+ 40, 8, 0, 0, 0, 0, 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, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 18, 20, 20, 20, 20, 18, 9, 18, 9,
+ 40, 38, 9, 18, 42, 0, 0, 0, 0, 0, 0, 0, 41, 9, 18, 18, 9, 18, 18, 20, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 40, 40, 40, 40, 43, 20, 9, 18, 9, 18, 20, 9, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40],
"height":20,
"id":1,
"name":"Tile Layer 1",
@@ -42,7 +42,7 @@
"tilesets":[
{
"firstgid":1,
- "source":"tileset.tsj"
+ "source":"..\/tileset.tsj"
}],
"tilewidth":16,
"type":"map",
diff --git a/res/rooms/room_begin_secret_1.tmj b/res/rooms/room_begin_secret_1.tmj
new file mode 100644
index 0000000..94b5eb2
--- /dev/null
+++ b/res/rooms/room_begin_secret_1.tmj
@@ -0,0 +1,51 @@
+{ "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, 27, 19, 31, 31, 31, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 40, 40, 21, 31, 17, 0, 0, 0, 0, 16, 31, 31, 19, 31, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 40, 27, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 19, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 27, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 17, 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, 40, 40, 40, 40,
+ 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, 40, 40, 40, 40,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 18, 18, 20, 18, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 9, 9, 20, 9, 18, 18, 18, 9, 18, 18, 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, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 40, 40, 40, 40, 40, 40, 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":"Tile Layer 1",
+ "opacity":1,
+ "type":"tilelayer",
+ "visible":true,
+ "width":30,
+ "x":0,
+ "y":0
+ }],
+ "nextlayerid":2,
+ "nextobjectid":1,
+ "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":30
+} \ No newline at end of file
diff --git a/res/tileset.tsj b/res/tileset.tsj
index 1aa009f..9c42c22 100644
--- a/res/tileset.tsj
+++ b/res/tileset.tsj
@@ -1,6 +1,6 @@
{ "backgroundcolor":"#444444",
"columns":11,
- "image":"tilesets.png",
+ "image":"img\/tilesets.png",
"imageheight":64,
"imagewidth":176,
"margin":0,
@@ -484,7 +484,6 @@
"objectgroup":
{
"draworder":"index",
- "id":2,
"name":"",
"objects":[
{
@@ -521,7 +520,6 @@
"objectgroup":
{
"draworder":"index",
- "id":2,
"name":"",
"objects":[
{
@@ -608,7 +606,6 @@
"objectgroup":
{
"draworder":"index",
- "id":2,
"name":"",
"objects":[
{
@@ -645,7 +642,6 @@
"objectgroup":
{
"draworder":"index",
- "id":2,
"name":"",
"objects":[
{
diff --git a/res/world.tiled-session b/res/world.tiled-session
index b5833be..f989b50 100644
--- a/res/world.tiled-session
+++ b/res/world.tiled-session
@@ -3,51 +3,84 @@
"height": 4300,
"width": 2
},
- "activeFile": "tileset.tsj",
+ "activeFile": "rooms/room_begin_secret_1.tmj",
"expandedProjectPaths": [
+ "rooms",
"."
],
"fileStates": {
"room_begin.tmj": {
- "scale": 1.5,
+ "scale": 0.75,
"selectedLayer": 0,
"viewCenter": {
- "x": 180,
- "y": 278.99999999999994
+ "x": 281.33333333333337,
+ "y": 403.33333333333326
}
},
"room_begin_1.tmj": {
+ "scale": 0.33,
+ "selectedLayer": 0,
+ "viewCenter": {
+ "x": 433.33333333333337,
+ "y": 816.6666666666666
+ }
+ },
+ "rooms/room_begin.tmj": {
+ "scale": 1.8485416666666665,
+ "selectedLayer": 0,
+ "viewCenter": {
+ "x": 240.1893384424659,
+ "y": 159.85574213907358
+ }
+ },
+ "rooms/room_begin_1.tmj": {
"scale": 1,
"selectedLayer": 0,
"viewCenter": {
- "x": 505,
- "y": 245.5
+ "x": 648,
+ "y": 349.5
}
},
+ "rooms/room_begin_secret_1.tmj": {
+ "scale": 1,
+ "selectedLayer": 0,
+ "viewCenter": {
+ "x": 24,
+ "y": 129.5
+ }
+ },
+ "rooms/tileset.tsj": {
+ "scaleInDock": 1
+ },
"tileset.tsj": {
"scaleInDock": 1,
"scaleInEditor": 3
}
},
- "last.imagePath": "/home/xswan/demonchime/res",
+ "last.externalTilesetPath": "/home/xswan/demonchime/res",
+ "last.imagePath": "/home/xswan/demonchime/res/img",
"last.worldFilePath": "/home/xswan/demonchime/res",
"loadedWorlds": [
- "/home/xswan/demonchime/res/map.world"
+ "/home/xswan/demonchime/res/rooms.world"
],
"map.lastUsedFormat": "json",
"map.tileHeight": 16,
"map.tileWidth": 16,
"openFiles": [
- "room_begin_1.tmj",
- "room_begin.tmj",
- "tileset.tsj"
+ "tileset.tsj",
+ "rooms/room_begin_1.tmj",
+ "rooms/room_begin.tmj",
+ "rooms/room_begin_secret_1.tmj"
],
"project": "world.tiled-project",
- "property.type": "int",
+ "property.type": "string",
"recentFiles": [
- "room_begin_1.tmj",
+ "tileset.tsj",
+ "rooms/room_begin_1.tmj",
+ "rooms/room_begin.tmj",
+ "rooms/room_begin_secret_1.tmj",
"room_begin.tmj",
- "tileset.tsj"
+ "room_begin_1.tmj"
],
"tileset.lastUsedFormat": "json",
"tileset.tileSize": {
diff --git a/src.bin b/src.bin
deleted file mode 100755
index 45f482a..0000000
--- a/src.bin
+++ /dev/null
Binary files differ
diff --git a/src/assets.odin b/src/assets.odin
index f4ffc00..5d78333 100644
--- a/src/assets.odin
+++ b/src/assets.odin
@@ -9,24 +9,29 @@ package demonchime
import rl "vendor:raylib"
Image_Id :: enum {
- PLAYER,
TILESETS,
+ PLAYER,
}
Animation_Id :: enum {
- PLAYER,
NONE,
+ PLAYER,
}
Room_Id :: enum {
- ROOM_BEGIN_1,
ROOM_BEGIN,
+ ROOM_BEGIN_1,
+ ROOM_BEGIN_SECRET_1,
}
Tileset_Id :: enum {
TILESET,
}
+Object_Type :: enum {
+ PLAYER_SPAWN,
+}
+
Resource_Id :: union {
Image_Id,
Animation_Id,
@@ -35,24 +40,23 @@ Resource_Id :: union {
}
images: [Image_Id]Image_Resource = {
- .PLAYER = {data = #load("../.compiled-res/player-sheet.qoi"), anim = .PLAYER},
.TILESETS = {data = #load("../.compiled-res/tilesets.qoi"), anim = .NONE},
+ .PLAYER = {data = #load("../.compiled-res/player-sheet.qoi"), anim = .PLAYER},
}
animations: [Animation_Id]Animation_Resource = {
- .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}}},
.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 = {"jump_up"={from = 14, to = 15}, "jump_down"={from = 17, to = 18}, "jump_trans"={from = 16, to = 16}, "sleep"={from = 19, to = 22}, "run"={from = 6, to = 13}, "idle"={from = 0, to = 5}}},
}
-//odinfmt: disable
-
rooms: [Room_Id]Room_Resource = {
- .ROOM_BEGIN_1 = {width=30, 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, 21, 19, 19, 19, 19, 31, 31, 28, 40, 40, 40, 40, 40, 40, 40, 27, 31, 19, 31, 31, 31, 19, 19, 31, 31, 31, 31, 19, 19, 19, 17, 0, 0, 0, 0, 0, 0, 10, 28, 40, 40, 21, 19, 31, 31, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 21, 17, 0, 0, 0,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 9, 20, 20, 20, 18, 18, 18, 20, 8, 0, 0, 0, 0, 0, 0, 5, 18, 9, 9, 20, 20, 20, 18, 9, 18, 9, 18, 18, 9, 39, 40, 40, 40, 40, 40, 40, 40, 40, 43, 20, 20, 9, 20, 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}}, objects={}, background_image=nil},
- .ROOM_BEGIN = {width=30, 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, 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, 21, 31, 31, 31, 11, 0, 0, 0, 0, 7, 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, 7, 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, 16, 40, 40, 21, 19, 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, 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, 27, 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, 0, 0, 0, 41, 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, 7, 8, 0, 0, 0, 0, 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, 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, 7, 32, 0, 0, 0, 0, 0, 0, 5, 9, 20, 9, 20, 20, 20, 18, 20, 20, 18, 18, 9, 18, 9, 18, 6, 0, 0, 0, 0, 0, 7, 32, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 8, 0, 0, 0, 0, 0, 7, 11, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 38, 9, 9, 18, 18, 9, 39, 0, 0, 0, 5, 9, 20, 9, 44, 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, 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, 20, 9, 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, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 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},
+ .ROOM_BEGIN = {width=30, 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, 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, 21, 31, 31, 31, 11, 0, 0, 0, 0, 7, 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, 7, 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, 16, 40, 40, 21, 19, 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, 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, 27, 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, 0, 0, 0, 41, 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, 7, 8, 0, 0, 0, 0, 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, 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, 7, 32, 0, 0, 0, 0, 0, 0, 5, 9, 20, 9, 20, 20, 20, 18, 20, 20, 18, 18, 9, 18, 9, 18, 6, 0, 0, 0, 0, 0, 7, 32, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 8, 0, 0, 0, 0, 0, 7, 11, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 38, 9, 9, 18, 18, 9, 39, 0, 0, 0, 5, 9, 20, 9, 44, 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, 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, 20, 9, 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, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 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, 149}, parallax = {0, 0}, properties = {}}, }, background_image=nil},
+ .ROOM_BEGIN_1 = {width=30, 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, 27, 19, 31, 31, 19, 19, 31, 19, 19, 19, 19, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 21, 19, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 31, 19, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 27, 19, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 31, 28, 40, 40, 40, 40, 40, 40, 27, 31, 31, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 28, 40, 40, 40, 40, 27, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 28, 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, 7, 40, 40, 40, 8, 0, 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, 28, 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, 7, 40, 8, 0, 0, 0, 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, 8, 0, 0, 0, 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, 8, 0, 0, 0, 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, 8, 0, 0, 0, 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, 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, 7, 40, 8, 0, 0, 0, 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, 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, 40, 8, 0, 0, 0, 0, 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, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 18, 20, 20, 20, 20, 18, 9, 18, 9, 40, 38, 9, 18, 42, 0, 0, 0, 0, 0, 0, 0, 41, 9, 18, 18, 9, 18, 18, 20, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 43, 20, 9, 18, 9, 18, 20, 9, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40}}, objects={}, background_image=nil},
+ .ROOM_BEGIN_SECRET_1 = {width=30, 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, 27, 19, 31, 31, 31, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 21, 31, 17, 0, 0, 0, 0, 16, 31, 31, 19, 31, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 27, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 19, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 27, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 17, 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, 40, 40, 40, 40, 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, 40, 40, 40, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 18, 18, 20, 18, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 9, 9, 20, 9, 18, 18, 18, 9, 18, 18, 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, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 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},
}
tilesets: [Tileset_Id]Tileset_Resource = {
- .TILESET = {tiles={1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44}, image=.TILESETS},
+ .TILESET = {tiles={45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88}, image=.TILESETS},
}
tiles: []Tile_Resource = {
@@ -100,20 +104,64 @@ tiles: []Tile_Resource = {
{tileset=.TILESET, rect=Rect{start = {128, 48}, size = {16, 16}}, id=42, collisions={Rect{start = {0, 8}, size = {8, 8}}}},
{tileset=.TILESET, rect=Rect{start = {144, 48}, size = {16, 16}}, id=43, collisions={Rect{start = {0, 8}, size = {16, 8}}, Rect{start = {0, 0}, size = {8, 8}}}},
{tileset=.TILESET, rect=Rect{start = {160, 48}, size = {16, 16}}, id=44, collisions={Rect{start = {0, 8}, size = {16, 8}}, Rect{start = {8, 0}, size = {8, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {0, 0}, size = {16, 16}}, id=45, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {16, 0}, size = {16, 16}}, id=46, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {32, 0}, size = {16, 16}}, id=47, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {48, 0}, size = {16, 16}}, id=48, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {64, 0}, size = {16, 16}}, id=49, collisions={Rect{start = {8, 8}, size = {8, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {80, 0}, size = {16, 16}}, id=50, collisions={Rect{start = {0, 8}, size = {8, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {96, 0}, size = {16, 16}}, id=51, collisions={Rect{start = {8, 0}, size = {8, 16}}}},
+ {tileset=.TILESET, rect=Rect{start = {112, 0}, size = {16, 16}}, id=52, collisions={Rect{start = {0, 0}, size = {8, 16}}}},
+ {tileset=.TILESET, rect=Rect{start = {128, 0}, size = {16, 16}}, id=53, collisions={Rect{start = {0, 8}, size = {16, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {144, 0}, size = {16, 16}}, id=54, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {160, 0}, size = {16, 16}}, id=55, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {0, 16}, size = {16, 16}}, id=56, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {16, 16}, size = {16, 16}}, id=57, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {32, 16}, size = {16, 16}}, id=58, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {48, 16}, size = {16, 16}}, id=59, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {64, 16}, size = {16, 16}}, id=60, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {80, 16}, size = {16, 16}}, id=61, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {96, 16}, size = {16, 16}}, id=62, collisions={Rect{start = {0, 8}, size = {16, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {112, 16}, size = {16, 16}}, id=63, collisions={Rect{start = {0, 0}, size = {16, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {128, 16}, size = {16, 16}}, id=64, collisions={Rect{start = {0, 8}, size = {16, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {144, 16}, size = {16, 16}}, id=65, collisions={Rect{start = {8, 0}, size = {8, 8}}, Rect{start = {0, 8}, size = {8, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {160, 16}, size = {16, 16}}, id=66, collisions={Rect{start = {8, 8}, size = {8, 8}}, Rect{start = {0, 0}, size = {8, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {0, 32}, size = {16, 16}}, id=67, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {16, 32}, size = {16, 16}}, id=68, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {32, 32}, size = {16, 16}}, id=69, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {48, 32}, size = {16, 16}}, id=70, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {64, 32}, size = {16, 16}}, id=71, collisions={Rect{start = {8, 0}, size = {8, 8}}, Rect{start = {0, 8}, size = {8, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {80, 32}, size = {16, 16}}, id=72, collisions={Rect{start = {8, 8}, size = {8, 8}}, Rect{start = {0, 0}, size = {8, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {96, 32}, size = {16, 16}}, id=73, collisions={Rect{start = {0, 8}, size = {8, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {112, 32}, size = {16, 16}}, id=74, collisions={Rect{start = {8, 8}, size = {8, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {128, 32}, size = {16, 16}}, id=75, collisions={Rect{start = {0, 0}, size = {16, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {144, 32}, size = {16, 16}}, id=76, collisions={Rect{start = {0, 0}, size = {8, 16}}}},
+ {tileset=.TILESET, rect=Rect{start = {160, 32}, size = {16, 16}}, id=77, collisions={Rect{start = {8, 0}, size = {8, 16}}}},
+ {tileset=.TILESET, rect=Rect{start = {0, 48}, size = {16, 16}}, id=78, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {16, 48}, size = {16, 16}}, id=79, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {32, 48}, size = {16, 16}}, id=80, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {48, 48}, size = {16, 16}}, id=81, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {64, 48}, size = {16, 16}}, id=82, collisions={Rect{start = {0, 8}, size = {16, 8}}, Rect{start = {0, 0}, size = {8, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {80, 48}, size = {16, 16}}, id=83, collisions={Rect{start = {0, 8}, size = {16, 8}}, Rect{start = {8, 0}, size = {8, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {96, 48}, size = {16, 16}}, id=84, collisions={}},
+ {tileset=.TILESET, rect=Rect{start = {112, 48}, size = {16, 16}}, id=85, collisions={Rect{start = {8, 8}, size = {8, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {128, 48}, size = {16, 16}}, id=86, collisions={Rect{start = {0, 8}, size = {8, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {144, 48}, size = {16, 16}}, id=87, collisions={Rect{start = {0, 8}, size = {16, 8}}, Rect{start = {0, 0}, size = {8, 8}}}},
+ {tileset=.TILESET, rect=Rect{start = {160, 48}, size = {16, 16}}, id=88, collisions={Rect{start = {0, 8}, size = {16, 8}}, Rect{start = {8, 0}, size = {8, 8}}}},
}
-//odinfmt: enable
-
world: []Room_Position_Resource = {
- {id=.ROOM_BEGIN_1, x=-528, y=-64, width=480, height=320},
- {id=.ROOM_BEGIN, x=-48, y=-64, width=480, height=320},
+ {id=.ROOM_BEGIN, x=307, y=292, width=480, height=320},
+ {id=.ROOM_BEGIN_1, x=-173, y=292, width=480, height=320},
+ {id=.ROOM_BEGIN_SECRET_1, x=787, y=292, width=480, height=320},
}
path_to_id: map[string]Resource_Id = {
+ "res/rooms/room_begin_secret_1.tmj" = Room_Id.ROOM_BEGIN_SECRET_1,
+ "res/rooms/room_begin.tmj" = Room_Id.ROOM_BEGIN,
+ "res/rooms/room_begin_1.tmj" = Room_Id.ROOM_BEGIN_1,
"res/img/player.ase" = Image_Id.PLAYER,
"res/img/tilesets.png" = Image_Id.TILESETS,
- "res/room_begin.tmj" = Room_Id.ROOM_BEGIN,
- "res/room_begin_1.tmj" = Room_Id.ROOM_BEGIN_1,
}
load_resources :: proc() {
diff --git a/src/main.odin b/src/main.odin
index 0ce4fac..3b0f203 100644
--- a/src/main.odin
+++ b/src/main.odin
@@ -140,9 +140,10 @@ main :: proc() {
rl.SetTraceLogCallback(raylib_log)
rl.InitWindow(480 * 2, 360 * 2, "Demonchime")
-
rl.SetWindowState({.WINDOW_RESIZABLE})
+ rl.SetTargetFPS(240)
+
init()
for !rl.WindowShouldClose() {
diff --git a/src/player.odin b/src/player.odin
index 71b015b..f2afd6c 100644
--- a/src/player.odin
+++ b/src/player.odin
@@ -218,3 +218,15 @@ update_player :: proc(dt: f32) {
draw_player :: proc() {
draw_sprite(player.sprite)
}
+
+@(private = "file")
+already_spawned_player := false
+
+player_spawn_object_spawner :: proc(obj: Object_Resource) {
+ if already_spawned_player {
+ return
+ }
+ already_spawned_player = true
+
+ phys.set_body_position(player.body_handle, obj.pos)
+}
diff --git a/src/resources.odin b/src/resources.odin
index 49e9603..0997585 100644
--- a/src/resources.odin
+++ b/src/resources.odin
@@ -20,6 +20,7 @@ Animation_Resource :: struct {
}
Object_Resource :: struct {
+ type: Object_Type,
pos: Vec2,
parallax: Vec2,
properties: map[string]any,
diff --git a/src/sprite.odin b/src/sprite.odin
index 803dd85..549373b 100644
--- a/src/sprite.odin
+++ b/src/sprite.odin
@@ -40,8 +40,6 @@ init_sprite :: proc(
sprite.width = i32(f32(sprite.image.width) / f32(anim.frame_count))
sprite.height = i32(sprite.image.height)
- log.debug(sprite.width, anim.frame_count, sprite.anim_id)
-
sprite.scale = Vec2{1, 1}
return true
@@ -96,6 +94,4 @@ draw_sprite :: proc(sprite: Sprite) {
sprite.rotation,
sprite.scale,
)
-
- // log.debug(rect)
}
diff --git a/src/world.odin b/src/world.odin
index 3248d65..4f3ee7f 100644
--- a/src/world.odin
+++ b/src/world.odin
@@ -1,16 +1,28 @@
package demonchime
-import "core:log"
-
import rl "vendor:raylib"
+Object_Spawner :: proc(Object_Resource)
+
current_room: Room_Position_Resource
+object_spawners := [Object_Type]Object_Spawner{
+ .PLAYER_SPAWN = player_spawn_object_spawner,
+}
+
+@(private = "file")
+spawn_objects :: proc(room_id: Room_Id) {
+ room := get_room(room_id)
+
+ for obj in room.objects {
+ object_spawners[obj.type](obj)
+ }
+}
+
open_room_at :: proc(pos: [2]i32) -> bool {
pos := pos
pos += {current_room.x, current_room.y}
- log.debug("trying to change room...", pos)
for room_pos in world {
if room_pos.id == current_room.id {
continue
@@ -21,6 +33,7 @@ open_room_at :: proc(pos: [2]i32) -> bool {
pos.y >= room_pos.y &&
pos.y <= room_pos.y + room_pos.height {
current_room = room_pos
+ spawn_objects(current_room.id)
return true
}
}
@@ -31,6 +44,7 @@ open_room :: proc(id: Room_Id) -> bool {
for room_pos in world {
if room_pos.id == id {
current_room = room_pos
+ spawn_objects(current_room.id)
return true
}
}
diff --git a/tools/compile_assets/main.odin b/tools/compile_assets/main.odin
index e33dc37..ea1ff90 100644
--- a/tools/compile_assets/main.odin
+++ b/tools/compile_assets/main.odin
@@ -33,6 +33,9 @@ Room_Id :: enum {
Tileset_Id :: enum {
<tileset-enum>}
+Object_Type :: enum {
+<object-types>}
+
Resource_Id :: union {
Image_Id,
Animation_Id,
@@ -46,8 +49,6 @@ images: [Image_Id]Image_Resource = {
animations: [Animation_Id]Animation_Resource = {
<anim-load>}
-//odinfmt: disable
-
rooms: [Room_Id]Room_Resource = {
<room-load>}
@@ -57,8 +58,6 @@ tilesets: [Tileset_Id]Tileset_Resource = {
tiles: []Tile_Resource = {
<tiles-load>}
-//odinfmt: enable
-
world: []Room_Position_Resource = {
<room-positions>}
@@ -79,6 +78,9 @@ tilesets: map[string]string
world: [dynamic]string
+// Don't want to add types multiple times, so it's a set
+object_type_names: map[string]struct{}
+
output_dir: string
paths_to_res_type: map[string]string
@@ -355,6 +357,26 @@ main :: proc() {
}
content = set_placeholder(content, "<resource-paths>", res_paths)
+ object_type_enum := ""
+
+ for object_type in object_type_names {
+ object_type_enum = strings.concatenate({
+ object_type_enum,
+ " ",
+ object_type,
+ ",\n"
+ }, allocator = context.temp_allocator)
+
+ delete(object_type)
+ }
+
+ content, _ = strings.replace_all(
+ content,
+ "<object-types>",
+ object_type_enum,
+ allocator = context.temp_allocator,
+ )
+
os.write_string(output_file, content)
for image in images {
@@ -369,4 +391,3 @@ main :: proc() {
free_all(context.temp_allocator)
}
-
diff --git a/tools/compile_assets/tiled.odin b/tools/compile_assets/tiled.odin
index 7752273..5311fa5 100644
--- a/tools/compile_assets/tiled.odin
+++ b/tools/compile_assets/tiled.odin
@@ -210,7 +210,12 @@ Json_Property :: struct {
name: string,
type: string,
propertytype: string,
- value: any,
+ value: union{
+ bool,
+ int,
+ string,
+ f32,
+ },
}
Json_Point :: struct {
@@ -415,33 +420,88 @@ load_json_room :: proc(path: string, file: ^os.File) {
}
}
+ objects: [dynamic]string
+ defer delete(objects)
+
layers: [dynamic][]u32
defer delete(layers)
for layer in json_dat.layers {
- if strings.compare(layer.type, "tilelayer") != 0 {
- continue
- }
+ switch layer.type {
+ case "tilelayer":
+ json_layer_dat, ok := layer.data.([]i32)
+ if !ok {
+ continue
+ }
- json_layer_dat, ok := layer.data.([]i32)
- if !ok {
- continue
- }
+ data := make(
+ []u32,
+ len(json_layer_dat),
+ allocator = context.temp_allocator,
+ )
+
+ for cell, i in json_layer_dat {
+ data[i] = tiled_to_real_gid[cell]
+ }
+
+ append(&layers, data)
+ case "objectgroup":
+ parallax := [2]f32{f32(layer.parallaxx), f32(layer.parallaxy)}
+
+ for obj in layer.objects {
+ type_name := strings.to_screaming_snake_case(obj.type)
- data := make([]u32, len(json_layer_dat), allocator = context.temp_allocator)
+ // `object_type_names` now owns `type_name`; freed in main
+ object_type_names[type_name] = {}
- for cell, i in json_layer_dat {
- data[i] = tiled_to_real_gid[cell]
+ pos := [2]f32{f32(obj.x), f32(obj.y)}
+
+ properties: map[string]union{
+ bool,
+ int,
+ string,
+ f32,
+ }
+ defer delete(properties)
+
+ for property in obj.properties {
+ fmt.println(property.name, property.value)
+ properties[property.name] = property.value
+ }
+
+ line := fmt.tprintf(
+ "{{type = .%v, pos = %w, parallax = %w, properties = %w}}",
+ type_name,
+ pos,
+ parallax,
+ properties,
+ )
+
+ append(&objects, line)
+ }
+ case:
+ fmt.eprintfln("WARNING: Unsupported tile layer type '%v'", layer.type)
}
+ }
+
+ objects_arr_str := ""
- append(&layers, data)
+ for obj in objects {
+ objects_arr_str = strings.concatenate({
+ objects_arr_str,
+ obj,
+ ", "
+ }, allocator = context.temp_allocator)
}
line := fmt.aprintf(
- "{{width=%v, height=%v, tile_width=%v, tile_height=%v, layers=%w, objects={{}}, background_image=nil}}",
- width, height,
- tile_width, tile_height,
+ "{{width=%v, height=%v, tile_width=%v, tile_height=%v, layers=%w, objects={{%v}}, background_image=nil}}",
+ width,
+ height,
+ tile_width,
+ tile_height,
layers[:],
+ objects_arr_str,
)
rooms[filepath.stem(path)] = line
}