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 | |
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')
-rw-r--r-- | entity/bunny.gbasm | 43 | ||||
-rw-r--r-- | entity/display.gbasm | 37 |
2 files changed, 72 insertions, 8 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 diff --git a/entity/display.gbasm b/entity/display.gbasm index 8a0daf1..ada77e2 100644 --- a/entity/display.gbasm +++ b/entity/display.gbasm @@ -77,7 +77,7 @@ Display_Entity: SUB C AND $0f SWAP A - ADD $02 + ADD $06 LD C, A LD A, $mem_map_loading_flags @@ -183,18 +183,45 @@ Display_Entity: .ADD_A_TO_DIRECTION_BC Display_Entity.Action_Animation.end: + Display_Entity.SuperJump_Animation: + LD A, D + AND $f0 + CP $30 + JR NZ, =Display_Entity.SuperJump_Animation.end + + LD A, $mem_moving_animation_step + CP $00 + JR Z, =Display_Entity.SuperJump_Animation.end + .ADD_A_TO_DIRECTION_BC + LD A, $mem_moving_animation_step + SUB $08 + .ABS + SLA A + CPL + INC A + ADD $16 + CPL + INC A + ADD C + LD C, A + Display_Entity.SuperJump_Animation.end: + Display_Entity.Moving_Hops: LD A, D - BIT 3, A - LD A, $00 - JR Z, =Display_Entity.Moving_Hops.not_moving + AND $f8 + CP $08 + JR NZ, =Display_Entity.Moving_Hops.end LD A, $mem_moving_animation_step - Display_Entity.Moving_Hops.not_moving: SUB $08 .ABS SUB $04 .ABS + CPL + INC A + ADD $04 + CPL + INC A ADD C LD C, A Display_Entity.Moving_Hops.end: |