![]() |
Routines |
| Prev: A8F4 | Up: Map | Next: AA15 |
|
Used by the routine at CheckMapObjectCollisions.
Makes the ship rebound after hitting something to its left or right: the horizontal speed of the ship is reversed and halved by ReverseAndHalveSpeed, and the horizontal scroll speed is negated.
|
||||
| BounceHorizontally | AA01 | PUSH HL | Stash HL on the stack. | |
| AA02 | LD HL,($C8EC) | Fetch the word at C8EC into HL. | ||
| AA05 | CALL ReverseAndHalveSpeed | Call ReverseAndHalveSpeed. | ||
| AA08 | LD ($C8EC),HL | Update the high byte of the ship's horizontal speed. | ||
| AA0B | POP HL | Bring HL back off the stack. | ||
| AA0C | LD A,($CCBB) | The horizontal scroll speed. | ||
| AA0F | NEG | Negate A. | ||
| AA11 | LD ($CCBB),A | Update the horizontal scroll speed. | ||
| AA14 | RET | Return. | ||
| Prev: A8F4 | Up: Map | Next: AA15 |