From ea4a115b8e640d5d17014a50fd3199ba4cc6494f Mon Sep 17 00:00:00 2001 From: Astatin Date: Mon, 18 Nov 2024 16:58:13 +0900 Subject: Check collisions on hop and cancel if collision --- entity/display.gbasm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'entity/display.gbasm') diff --git a/entity/display.gbasm b/entity/display.gbasm index ce176a4..8b5f110 100644 --- a/entity/display.gbasm +++ b/entity/display.gbasm @@ -208,6 +208,29 @@ Display_Entity: LD C, A Display_Entity.SuperJump_Animation.end: + Display_Entity.Shaking_Animation: + LD A, D + AND $f0 + CP $40 + JR NZ, =Display_Entity.Shaking_Animation.end + + LD A, $mem_moving_animation_step + CP $00 + JR Z, =Display_Entity.Shaking_Animation.end + LD A, $mem_moving_animation_step + SRA A + AND $03 + BIT 1, A + RES 1, A + JR NZ, =Display_Entity.Shaking_Animation.skip_invert + CPL + INC A + Display_Entity.Shaking_Animation.skip_invert: + DBG + ADD B + LD B, A + Display_Entity.Shaking_Animation.end: + Display_Entity.Moving_Hops: LD A, D AND $f8 -- cgit v1.2.3-70-g09d2