Prev: 43521 Up: Map Next: 43559
43541: Bounce Vertically
Used by the routine at CheckMapObjectCollisions.
Makes the ship rebound after hitting something above or below it: the vertical speed of the ship is reversed and halved by ReverseAndHalveSpeed.
BounceVertically 43541 PUSH HL Stash HL on the stack.
43542 LD HL,(51438) Fetch the word at 51438 into HL.
43545 CALL ReverseAndHalveSpeed Call ReverseAndHalveSpeed.
43548 LD (51438),HL Update the high byte of the ship's vertical speed.
43551 LD A,H A=H.
43552 LD H,L H=L.
43553 LD L,A L=A.
43554 CALL UpdateVerticalScrollSpeed Call UpdateVerticalScrollSpeed.
43557 POP HL Bring HL back off the stack.
43558 RET Return.
Prev: 43521 Up: Map Next: 43559