WIP: exit direction selection
authorLukas Krickl <lukas@krickl.dev>
Mon, 23 Dec 2024 08:02:49 +0000 (09:02 +0100)
committerLukas Krickl <lukas@krickl.dev>
Mon, 23 Dec 2024 08:02:49 +0000 (09:02 +0100)
src/map.s

index 3c2efb27de83020d56eae9ee4eb009da3252e178..dfe844d50f0a2ca2fb7a0084570a898188fa3921 100644 (file)
--- a/src/map.s
+++ b/src/map.s
@@ -71,8 +71,23 @@ room_goto_player_pos:
 
   ; compare to expected positions to decide what to do
 
+  ; 0/0 == north
+  xor a, a ; a = 0 
+
+  ; d == 0 && e == 0
+  cp a, d
+  jr nz, @not_north REL 
+  cp a, e
+  jr nz, @not_north REL
+
+  ; load north as direction
+  ld a, NORTH 
+  jp room_goto 
+@not_north:
+
   ; default use special exit
   ld a, EXIT_SPECIAL 
+  ; no need to jmp in default case
 
   ; transitions to a new room 
   ; that is part of the map: