![]() |
Routines |
| Prev: A99F | Up: Map | Next: A9DD |
|
Used by the routines at TryMove and MoveDestroyer.
Moves an entity in the direction that it is heading, by up to the number of steps that is given. The entity stops at the start of a cell if the next cell is not empty. The routine keeps a copy of the position, so that a move can be undone.
|
||||||||||||||||||||||||||
| MoveEntity | A9C3 | LD ($9653),DE | Keep the X position... | |||||||||||||||||||||||
| A9C7 | LD ($9655),HL | ...and the Y position, so that the move can be undone. | ||||||||||||||||||||||||
| A9CA | LD A,(IX+$07) | Fetch the direction of the entity... | ||||||||||||||||||||||||
| A9CD | AND $03 | ...and jump to move in direction zero (X decreasing)... | ||||||||||||||||||||||||
| A9CF | JP Z,MoveLeft | |||||||||||||||||||||||||
| A9D2 | DEC A | ...or direction one (Y increasing)... | ||||||||||||||||||||||||
| A9D3 | JP Z,MoveUp | |||||||||||||||||||||||||
| A9D6 | DEC A | ...or direction two (X increasing)... | ||||||||||||||||||||||||
| A9D7 | JP Z,MoveRight | |||||||||||||||||||||||||
| A9DA | JP MoveDown | ...or otherwise direction three (Y decreasing). | ||||||||||||||||||||||||
| Prev: A99F | Up: Map | Next: A9DD |