From: Lukas Krickl Date: Thu, 6 Feb 2025 15:56:53 +0000 (+0100) Subject: state: adding states for bat enemy X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=627afa01ed7d4993ec5ffbd7a2f8da2cde43faf8;p=gbrg%2F.git state: adding states for bat enemy --- 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 +