Prev: 53403 Up: Map Next: 53526
53484: Creature's missile has hit Maroc's shield/barrier
This causes the creature's missile to rebound off the shield at high speed. The diverted missile/bolt can even close open doors if it collides with a door handle.
creature missile rebounding of Maroc's protective barrier
Calculate the missile's new horizontal trajectory:
53484 LD A,(60096) Maroc's horizontal (X-axis) screen position, in 4-pixel/half-character steps
53487 LD C,A
53488 LD A,(60232) Missile's horizontal (X-axis) screen position, in 4-pixel/half-character steps
53491 SUB C Subtract Maroc's position from missile position
53492 RLA
53493 SBC A,A The RLA and SBC sets A to 0 or 255 depending on whether the missile position is to Maroc's left or right
53494 XOR 15 Based on direction, sets the above calculated value at 240 (-15) or +15
53496 LD C,A
53497 LD A,(60236) Get the missile's existing horizontal movement speed
53500 ADD A,C Add the calculated value (+/- 15)
53501 LD (60236),A ...and re-store.
Calculate the missile's new vertical trajectory
53504 LD A,(60097) Maroc's vertical (Y-axis) pixel screen position
53507 LD C,A Missile's vertical (X-axis) pixel screen position
53508 LD A,(60234)
53511 SUB C Subtract Maroc's position from missile position
53512 RLA
53513 SBC A,A The RLA and SBC sets A to 0 or 255 depending on whether the missile position is above or below Maroc
53514 XOR 15 Based on direction, sets the above calculated value at 240 (-15) or +15
53516 LD C,A
53517 LD A,(60237) Get the missile's existing vertical movement speed
53520 ADD A,C Add the calculated value (+/- 15)
53521 LD (60237),A ...and re-store.
53524 JR 53550
Prev: 53403 Up: Map Next: 53526