aboutsummaryrefslogtreecommitdiff
path: root/entity/bunny.gbasm
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-01-24 18:08:33 +0900
committerAstatin <[email protected]>2025-01-24 18:08:33 +0900
commit1a6621e5b1da42ee4b6b9132790ec744efc009c2 (patch)
tree89aeb457555655d2e4ed74a0fe32bfca74851a26 /entity/bunny.gbasm
parent57326c9acf9cbb025d54093fb90fd70614659400 (diff)
Add laser enemy attack
Diffstat (limited to 'entity/bunny.gbasm')
-rw-r--r--entity/bunny.gbasm36
1 files changed, 25 insertions, 11 deletions
diff --git a/entity/bunny.gbasm b/entity/bunny.gbasm
index 042f94b..7e9afa5 100644
--- a/entity/bunny.gbasm
+++ b/entity/bunny.gbasm
@@ -1,14 +1,4 @@
Move_Bunny:
- LD A, $mem_bunny_health
- CP $00
- JR NZ, =.not_dead
-
- LD A, $20
- LD $mem_bunny_direction, A
- RET
-
- .not_dead:
-
LD A, $mem_bunny_flags
LD E, $01
BIT 0, A
@@ -60,7 +50,7 @@ Move_Bunny:
.Start_action_or_movement:
LD A, $mem_map_loading_flags
BIT 3, A
- JR NZ, =.Start_action_or_movement.end
+ JP NZ, =.Start_action_or_movement.end
.Start_action_or_movement.test_movement:
@@ -91,6 +81,25 @@ Move_Bunny:
LD A, D
LD $mem_bunny_direction, A
+
+ BIT 3, D
+ JR Z, =.Start_action_or_movement.end
+
+ PUSH BC
+ LD A, B
+ LD B, C
+ LD C, A
+ LD A, $01
+ DBG
+ .ADD_A_TO_DIRECTION_BC
+ DBG
+ LD A, B
+ LD $mem_bunny_predicted_x, A
+ LD A, C
+ LD $mem_bunny_predicted_y, A
+
+ POP BC
+
JR =.Start_action_or_movement.end
.Start_action_or_movement.test_action:
@@ -225,6 +234,11 @@ Move_Bunny:
.End_movement.Update_current_room.end:
POP DE
+ LD A, $mem_bunny_x
+ LD $mem_bunny_predicted_x, A
+ LD A, $mem_bunny_y
+ LD $mem_bunny_predicted_y, A
+
.End_movement.end:
.Middle_movement_doublespeed_viewport_update: