Prev: 53526 Up: Map Next: 53601
53550: Check missile room boundary collisions and on-screen lifespan
Used by the routines at 53484 and 53526.
No collision between a creature missile and Maroc (jump from 53540), or the missile has been fired by Maroc (jump from 53531)
Missiles hitting a wall will bounce off like any other room objects.
bolt rebounding off a wall missile rebounding off a wall
Check for collisions with room walls:
53550 CALL 56008 Check that the missile isn't moving below the bottom of the room boundary. Return any adjusted vertical pixel position in the E register
53553 CALL 57401 Run collision detection routine for room walls, adjusting horizontal position if needed.
Missiles have varied lifespans. Note from the animated images how the VAPORIZE spell bolt lasts longer than the MISSILE spell.
The second byte in the missile sets at 27868 holds this information.
Reduce this missile's timer, and make it disappear if its timer has run out.
53556 LD A,(60238) Item properties byte.
For missiles, the value contained in the top 4 bits of this byte tells holds the duration this missile will appear/travel for before it disappears.
53559 SUB 16 Reduce the time/distance of this value by 16 (initial values are between 144 and 240)
53561 JR C,53569
53563 LD (60238),A If the missile is still with us, jump out to the next routine
53566 JP 53885
Jump here from 53408 if missile is off-screen, or the missile's lifespan has finished/fizzled out
53569 LD A,(60227) Object type
53572 CP 5 Type 5 = Missile fired by a creature/warlock
53574 JR Z,53581
53576 LD HL,60306 Missile fired by Maroc
53579 JR 53584
53581 LD HL,60305 Missile fired by creature/warlock
HL now contains:
  • 60305 if missile fired by creature/warlock
  • 60306 if missile fired by Maroc
53584 DEC (HL) Maroc's missile - decrement Maroc's missile count (from one to zero)
Creature missile - decrement number of creature missiles in room (from one to zero)
53585 LD A,0
53587 LD (60227),A Missile has fizzled out, so set item type to 0
53590 LD A,(60238) Get item properties byte
53593 OR 4 Set bit 2 (4) - this indicates the graphic will need erasing
53595 LD (60238),A ...and re-store.
53598 JP 53885
Prev: 53526 Up: Map Next: 53601