Prev: EB1D Up: Map Next: EBBB
EB27: Room Event : Angels of Death.
Used by the routine at Update_Room00.
Input
Output
Angel bitmap indices are $93 ~ $98
Handler_Angels EB27 LD A,(Flag_BaddyInit) See if angels have been intialised.
EB2A OR A
EB2B JR NZ,Handler_Angels_0
Initialise
EB2D LD A,$01 Set as initialised.
EB2F LD (Flag_BaddyInit),A
EB32 INC A Set directions all the same.
EB33 LD (Angel1_Direction),A
EB36 LD (Angel2_Direction),A
EB39 LD (Angel3_Direction),A
EB3C LD HL,$3278 Set positions and draw each angel.
EB3F LD (Angel1_Pos),HL
EB42 LD (BitmapX),HL
EB45 LD A,(Angel_Bmp)
EB48 CALL Bitmap16Draw
EB4B LD HL,$6438
EB4E LD (Angel2_Pos),HL
EB51 LD (BitmapX),HL
EB54 CALL Bitmap16Draw
EB57 LD HL,$50B8
EB5A LD (Angel3_Pos),HL
EB5D LD (BitmapX),HL
EB60 CALL Bitmap16Draw
EB63 RET
Update
Handler_Angels_0 EB64 LD A,(Angel_Bmp) Get bitmap frame for all angels.
EB67 INC A Update to next frame.
EB68 CP $99 Check to see if frame needs to loop around.
EB6A JR NZ,Handler_Angels_1
EB6C LD A,$93
Handler_Angels_1 EB6E LD D,A Store frame for now.
EB6F LD IX,Angel1_Pos Point index to first angel.
EB73 LD B,$03 Number of angels to update.
Handler_Angels_2 EB75 LD L,(IX+$00) Get x position.
EB78 LD H,(IX+$01) Get y postion.
EB7B LD C,(IX+$02) Get direction / velocity
EB7E INC IX Point to next angel.
EB80 INC IX
EB82 INC IX
EB84 LD (BitmapX),HL Tell bitmap draw position.
EB87 LD A,H Update position by velocity.
EB88 ADD A,C
EB89 LD H,A
EB8A CP $AA See if at bottom of screen.
EB8C JR NZ,Handler_Angels_4
Handler_Angels_3 EB8E LD A,C If at bottom reverse direction.
EB8F NEG
EB91 LD C,A
EB92 JR Handler_Angels_5
Handler_Angels_4 EB94 CP $30 See if at top of screen.
EB96 JR Z,Handler_Angels_3 Reverse...
Handler_Angels_5 EB98 LD (IX-$01),C Store new position and direction.
EB9B LD (IX-$02),H
EB9E LD A,(Angel_Bmp) Set draw with previous bitmap.
EBA1 CALL Bitmap16Draw Use draw to erase old frame.
EBA4 LD (BitmapX),HL Set for new position.
EBA7 LD A,D Get new frame and draw.
EBA8 CALL Bitmap16Draw
EBAB PUSH BC
EBAC PUSH DE
EBAD LD B,$04 Amount of energy loss if angel hits wally.
EBAF CALL Wally_HitTest
EBB2 POP DE
EBB3 POP BC
EBB4 DJNZ Handler_Angels_2 Next angel.
EBB6 LD A,D Update new frame for next time.
EBB7 LD (Angel_Bmp),A
EBBA RET
Prev: EB1D Up: Map Next: EBBB