This repository was archived by the owner on Sep 21, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -514,6 +514,7 @@ Level_TransitionUp:
514514 ld a ,[ Engine_CameraY ]
515515 sub SCRN_Y/ 16
516516 ld [ Engine_CameraY ], a
517+ call TransitionUpdateMonsters
517518 call BeginSprites
518519 call DrawPlayer
519520 call RenderMonsters
@@ -570,6 +571,7 @@ Level_TransitionDown:
570571 ld a ,[ Engine_CameraY ]
571572 add SCRN_Y/ 16
572573 ld [ Engine_CameraY ], a
574+ call TransitionUpdateMonsters
573575 call BeginSprites
574576 call DrawPlayer
575577 call RenderMonsters
Original file line number Diff line number Diff line change 22; Object System
33; ==============
44
5- ; TODO
6- ; - Object Behaviors
7-
85section "Object Memory" , wram0
96
107MONSTER_COUNT equ 16 ; maximum number of monster slots
@@ -1508,6 +1505,33 @@ UpdateMonsters:
15081505 ld [ Engine_CurrentScreen ], a
15091506 ret
15101507
1508+ TransitionUpdateMonsters:
1509+ ld b , 0
1510+ ld c , MONSTER_COUNT - 1
1511+ ld a ,[ Engine_CameraY ]
1512+ ld d , a
1513+ .updateLoop:
1514+ ld hl , Monster_ID
1515+ add hl , bc
1516+ ld a ,[ hl ]
1517+ or a
1518+ jr z , .nextMonster
1519+ ld hl , Monster_YPosition
1520+ add hl , bc
1521+ ld a ,[ hl ]
1522+ cp d
1523+ jr c , .removeMonster
1524+ sub SCRN_Y
1525+ cp d
1526+ jr c , .nextMonster
1527+ .removeMonster:
1528+ call DeleteMonster
1529+ .nextMonster:
1530+ dec c
1531+ bit 7 , c
1532+ jr nz , .updateLoop
1533+ ret
1534+
15111535; Update Monster animations
15121536AnimateMonsters:
15131537 ld b , 0
You can’t perform that action at this time.
0 commit comments