Prev: 69B3 Up: Map Next: 69DB
69BB: Fire Streamer
Used by the routine at FireWeapon.
Starts a streamer in the weapon slot held in FreeWeaponSlot, in front of Robbie. It is not fired if Robbie is too close to the edge of the play area. The colour of the streamer is chosen at random.
Input
DE State_Robbie_Colour (the colour of Robbie)
HL The weapon object
FireStreamer 69BB CALL GetRobbieDirection Get the X position and the direction using GetRobbieDirection.
69BE JR Z,FireStreamer_Right Jump to FireStreamer_Right if the streamer goes to the right.
69C0 CP $38 Return if Robbie is too close to the left edge.
69C2 RET C
69C3 SUB $0C Subtract 0C from the X position (so it starts to the left of Robbie).
69C5 LD (HL),$52 Write 52 (a streamer moving left) to the state of the weapon.
This entry point is used by the routine at FireStreamer_Right.
FireStreamer_Colour 69C7 PUSH AF Stash the X position on the stack.
69C8 PUSH HL Stash the weapon object on the stack.
69C9 LD A,($5E19) A=the random number from RandomNumber.
69CC AND %00000011 Keep only bits 0-1 (a random colour number from 00 to 03).
69CE LD C,A C=the random colour number.
69CF LD B,$00 Clear the high byte of the offset in B.
69D1 LD HL,$69DB HL=StreamerColours.
69D4 ADD HL,BC Add the offset to find the colour in the table.
69D5 LD B,(HL) B=the colour of the streamer.
69D6 POP HL Restore the weapon object from the stack.
69D7 POP AF Restore the X position from the stack.
69D8 JP CreateWeapon Jump to CreateWeapon to create the weapon.
Prev: 69B3 Up: Map Next: 69DB