From 627afa01ed7d4993ec5ffbd7a2f8da2cde43faf8 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Thu, 6 Feb 2025 16:56:53 +0100 Subject: [PATCH] state: adding states for bat enemy --- src/state.s | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/state.s b/src/state.s index e176932..b0f0a30 100644 --- a/src/state.s +++ b/src/state.s @@ -110,6 +110,32 @@ sm_player_poll_inputs: ret + ; picks a direction for + ; a bat to move in + ; then transitions to move state + ; after verifying collision + ; otherwise -> end turn +sm_bat_pick_direction: + ; move bat in random direction + call rand + and a, 0b11 ; rnadom direction 0-3 + + ; call correct movement setup + cp a, NORTH + call z, actor_up + cp a, SOUTH + call z, actor_down + cp a, WEST + call z, actor_left + cp a, EAST + call z, actor_right + + ; verify collision + + ; transition + + ret + ; loads initial state if ; state is 0 ; inputs: @@ -132,3 +158,4 @@ sm_load_initial_state: @done: pop de ret + -- 2.30.2