diff options
| author | iamcheeseman <[hidden email]> | 2026-01-15 16:17:16 -0500 |
|---|---|---|
| committer | iamcheeseman <[hidden email]> | 2026-01-15 16:17:16 -0500 |
| commit | 86738d3406671046ce50a2d1b07d858e14b2f968 (patch) | |
| tree | 3261e9fb85d7a438a6d5e37df447e209e3b26532 /src/world.odin | |
| parent | 4563dfa077e029fbefd192f087338d186155ebfc (diff) | |
Ensure upwards and downwards transitions work
Diffstat (limited to 'src/world.odin')
| -rw-r--r-- | src/world.odin | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/world.odin b/src/world.odin index d6f611e..eca934c 100644 --- a/src/world.odin +++ b/src/world.odin @@ -1,5 +1,7 @@ package demonchime +import "core:log" + import rl "vendor:raylib" Object_Spawner :: proc(Object_Resource) @@ -40,6 +42,8 @@ _open_room :: proc(room_pos: Room_Position_Resource) { current_room = room_pos + log.infof("Opened room %v", current_room.id) + for cb in room_open_cb { cb(current_room.id) } @@ -47,6 +51,16 @@ _open_room :: proc(room_pos: Room_Position_Resource) { _spawn_objects(current_room.id) } +point_inside_room :: proc(pos: Vec2) -> bool { + width := f32(current_room.width) + height := f32(current_room.height) + + return pos.x >= 0 && + pos.x <= width && + pos.y >= 0 && + pos.y <= height +} + open_room_at :: proc(pos: [2]i32) -> bool { pos := pos pos += {current_room.x, current_room.y} |
