diff options
author | Astatin <[email protected]> | 2024-10-10 17:42:11 +0900 |
---|---|---|
committer | Astatin <astatin@redacted> | 2024-10-10 17:42:11 +0900 |
commit | 10aed52daf8f06032342504c4a5fffa81031a90e (patch) | |
tree | a3ccd072f40cfcffcb63c51e444926481ec8da5d /entity/actions.gbasm | |
parent | 1a0271bd1fc52361643bd95319f651ffbc05c4ef (diff) |
Fox not getting stuck on walls when following
Diffstat (limited to 'entity/actions.gbasm')
-rw-r--r-- | entity/actions.gbasm | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/entity/actions.gbasm b/entity/actions.gbasm index 37c4035..f04a8f7 100644 --- a/entity/actions.gbasm +++ b/entity/actions.gbasm @@ -97,7 +97,7 @@ Fox_AI: JP Z, =Fox_AI.Start_action_or_movement.end LD A, $mem_moving_animation_step CP $00 - JR NZ, =Fox_AI.Start_action_or_movement.end + JP NZ, =Fox_AI.Start_action_or_movement.end LD A, $mem_bunny_x LD $tmp_var_1, A @@ -136,10 +136,26 @@ Fox_AI: Fox_AI.Go_Right: LD A, $enum_direction_right - JR =Fox_AI.Direction_check_end + JR =Fox_AI.Check_Horizontal_Collision Fox_AI.Go_Left: LD A, $enum_direction_left - JR =Fox_AI.Direction_check_end + + Fox_AI.Check_Horizontal_Collision: + LD E, A + DEC E + LD A, $tmp_var_3 + XOR E + INC E + INC A + OR $08 + PUSH BC + CALL =Get_Position_After_Move + LD A, C + CALL =Is_Collisionable + POP BC + CP $00 + LD A, E + JR Z, =Fox_AI.Direction_check_end Fox_AI.Vertical: LD A, C |