diff options
author | Astatin <[email protected]> | 2024-11-14 19:05:56 +0900 |
---|---|---|
committer | Astatin <[email protected]> | 2024-11-14 19:05:56 +0900 |
commit | cfd36cc6a11923c8863b699e70b90149ad1c731a (patch) | |
tree | 1adb07333cb0bba92812cda105a4b2db2fc89fd8 /entity/bunny.gbasm | |
parent | 8a9209f59366c70da07c87e31d21ea0d4754bc84 (diff) |
[WIP] Adding hop attack (still need to enable back the normal map loading, there seem to be an off by one error on the entity while hopping in a positive direction, still need to split the loading in multiple frame to not go out of VBlank)
Diffstat (limited to 'entity/bunny.gbasm')
-rw-r--r-- | entity/bunny.gbasm | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/entity/bunny.gbasm b/entity/bunny.gbasm index 01206e8..7726bd8 100644 --- a/entity/bunny.gbasm +++ b/entity/bunny.gbasm @@ -9,6 +9,13 @@ Move_Bunny: Move_Bunny.not_dead: + LD A, $mem_bunny_flags + LD E, $01 + BIT 0, A + JR Z, =Normal_speed + LD E, $02 + Normal_speed: + Start_action_or_movement: LD A, $mem_map_loading_flags BIT 3, A @@ -77,7 +84,7 @@ Move_Bunny: LD B, A LD A, $mem_prepared_viewport_y LD C, A - LD A, $01 + LD A, E .ADD_A_TO_DIRECTION_BC LD A, B LD $mem_prepared_viewport_x, A @@ -95,14 +102,13 @@ Move_Bunny: LD A, $mem_bunny_direction BIT 3, A JR Z, =End_movement.end - LD $mem_bunny_direction, A LD D, A LD A, $mem_bunny_x LD B, A LD A, $mem_bunny_y LD C, A - LD A, $01 + LD A, E .ADD_A_TO_DIRECTION_BC LD A, B LD $mem_bunny_x, A @@ -119,8 +125,39 @@ Move_Bunny: LD $mem_viewport_x, A LD A, C LD $mem_viewport_y, A + + LD A, $mem_bunny_flags + RES 0, A + LD $mem_bunny_flags, A End_movement.end: + Middle_movement_doublespeed_viewport_update: + LD A, $mem_map_loading_flags + BIT 3, A + JP Z, =Middle_movement_doublespeed_viewport_update.end + LD A, $mem_moving_animation_step + CP $08 + JP NZ, =Middle_movement_doublespeed_viewport_update.end + LD A, $mem_bunny_direction + BIT 3, A + JR Z, =Middle_movement_doublespeed_viewport_update.end + LD A, E + CP $02 + JR NZ, =Middle_movement_doublespeed_viewport_update.end + + LD A, $mem_viewport_x + LD B, A + LD A, $mem_viewport_y + LD C, A + LD A, $01 + .ADD_A_TO_DIRECTION_BC + LD A, B + LD $mem_viewport_x, A + LD A, C + LD $mem_viewport_y, A + Middle_movement_doublespeed_viewport_update.end: + + Interaction: LD A, $mem_map_loading_flags BIT 3, A |