aboutsummaryrefslogtreecommitdiff
path: root/entity/bunny.gbasm
diff options
context:
space:
mode:
authorAstatin <[email protected]>2024-12-17 18:42:11 +0900
committerAstatin <[email protected]>2024-12-17 18:42:11 +0900
commit2b0c6081d8a2c48c1f8412aefdcec6c2222e716c (patch)
tree9f1986c74b549856fcd566ea33c0de24b8483782 /entity/bunny.gbasm
parentb4934d36f8a2f572c491a0d62f94b757221c6b68 (diff)
Respawn enemies in other rooms when less than 5 enemies alive
Diffstat (limited to 'entity/bunny.gbasm')
-rw-r--r--entity/bunny.gbasm55
1 files changed, 54 insertions, 1 deletions
diff --git a/entity/bunny.gbasm b/entity/bunny.gbasm
index 7d5a5d0..d3ea7af 100644
--- a/entity/bunny.gbasm
+++ b/entity/bunny.gbasm
@@ -104,7 +104,7 @@ Move_Bunny:
AND $07
BIT 3, D
LD $mem_bunny_direction, A
- JR Z, =End_movement.end
+ JP Z, =End_movement.end
LD A, $mem_bunny_x
LD B, A
@@ -131,6 +131,59 @@ Move_Bunny:
LD A, $mem_bunny_flags
RES 0, A
LD $mem_bunny_flags, A
+
+ PUSH DE
+ Update_current_room:
+ LD A, $ff
+ LD $mem_bunny_current_room_idx, A
+
+ LD HL, $mem_room_list
+
+ Update_current_room.loop:
+ LD A, $mem_bunny_x
+ LD D, A
+ LD E, (HL)
+ CP E
+ JR C, =Update_current_room.skip
+
+ LD A, E
+ INC HL
+ ADD (HL)
+ CP D
+ JR C, =Update_current_room.skip
+
+ INC HL
+
+ LD A, $mem_bunny_y
+ LD D, A
+ LD E, (HL)
+ CP E
+ JR C, =Update_current_room.skip
+
+ LD A, E
+ INC HL
+ ADD (HL)
+ CP D
+ JR C, =Update_current_room.skip
+
+ LD A, L
+ SUB $83
+ SRA A
+ SRA A
+
+ LD $mem_bunny_current_room_idx, A
+ JR =Update_current_room.end
+
+ Update_current_room.skip:
+ LD A, L
+ AND $fc
+ ADD $04
+ LD L, A
+ CP $a0
+ JR NZ, =Update_current_room.loop
+ Update_current_room.end:
+ POP DE
+
End_movement.end:
Middle_movement_doublespeed_viewport_update: