Added notes for room transitions
authorLukas Krickl <lukas@krickl.dev>
Sun, 15 Dec 2024 18:41:27 +0000 (19:41 +0100)
committerLukas Krickl <lukas@krickl.dev>
Sun, 15 Dec 2024 18:41:27 +0000 (19:41 +0100)
TODO.md
src/map.s

diff --git a/TODO.md b/TODO.md
index 25a16247be10da3fe94d156e04dcda3dba67e6a0..64a9e5e6a4e28a74537ec4233d86acc52e831c06 100644 (file)
--- a/TODO.md
+++ b/TODO.md
 - If direction is already taken, try again
 - If it fails after 4 tries advance to a new room and try again
 - Do this until all rooms are filled
+
+## Room transition
+
+When a player hits the edge of the map a room transition should start.
+A player can either go north, west, east or south. 
+The target room of a transition should be stored in a room exit table.
+When a transition happens the state of the previous room should be written back to sram (e.g. actor table).
+If possible make the animation smooth instead of simply blanking the screen.
index 9ccc926a0d4318cc54d4c11162f4d3de7d4e6166..4233cf4d6ba2ee566b265b1e73fcce564550859c 100644 (file)
--- a/src/map.s
+++ b/src/map.s
@@ -49,6 +49,13 @@ room_load_from:
   call room_load_actors
   ret
 
+  ; calls rom goto based on player position
+  ; inputs:
+  ;   curr_room_exits: ptr to exits table
+  ;   player_x/y: player position
+room_goto_player_pos:
+  ld a, NORTH
+
   ; transitions to a new room 
   ; that is part of the map:
   ; inputs:
@@ -307,7 +314,7 @@ room_get_flag_masked:
 
   ; exit table for empty exits 
 room_empty_exits:
-.db 0x00, 0x00
-.db 0x00, 0x00
-.db 0x00, 0x00
-.db 0x00, 0x00
+dw base_room_struct 
+dw base_room_struct 
+dw base_room_struct 
+dw base_room_struct