Added who_next call
authorLukas Krickl <lukas@krickl.dev>
Mon, 18 Nov 2024 17:04:04 +0000 (18:04 +0100)
committerLukas Krickl <lukas@krickl.dev>
Mon, 18 Nov 2024 17:04:04 +0000 (18:04 +0100)
src/actor.s

index b617ffc1ade2119c7f6a2e9e659347909636746a..806cfbef33aee6b048b9d9fb38ee1e261935652c 100644 (file)
@@ -128,3 +128,18 @@ anim_move:
   ld a, b 
 
   ret
+
+  ; advance to the next actor 
+  ; effectively ending the current actor's turn
+who_next:
+  ld a, [who]
+  inc a ; who++
+
+  ; if who > actor_max 
+  ; go to player 
+  cp a, ACTORS_MAX 
+  jr z, @no_player REL
+    ld a, WHO_PLAYER
+@no_player:
+  ld [who], a
+  ret