![]() |
Routines |
| Prev: 56845 | Up: Map | Next: 56938 |
|
Used by the routines at UpdateCreature, UpdateFragment, UpdateShot, UpdateThrownItem, UpdateMonster, SpeedPlayerUp and SetDirectionFromVelocity.
Tests whether an object can move in the direction that it is facing, by testing the cells that its front edge touches (including the cells that the velocity takes it into) for walls. A wall changes the velocity so that the object stops at the wall, and sets the flag for a collision (bit 0 of the flags).
|
||||||||
|
Clear bit 0 of the flags, then run the routine for the heading.
|
||||||||
| TestMove | 56921 | RES 0,(IX+7) | Clear the flag for a collision. | |||||
|
This entry point is used by the routines at UpdateShot, UpdateThrownItem and SetDirectionFromVelocity.
Run the routine for the heading, without clearing the flag.
|
||||||||
| TestMove_Keep | 56925 | LD A,(IX+6) | Fetch the direction that the object is facing. | |||||
| 56928 | RLCA | Move the direction into the lowest two bits. | ||||||
| 56929 | RLCA | |||||||
| 56930 | AND %00000011 | Keep only the direction. | ||||||
|
Run the routine for the direction.
|
||||||||
| 56932 | LD BC,56938 | Point BC at TestMoveRoutines. | ||||||
| 56935 | JP JumpToTableRoutine | Jump to JumpToTableRoutine. | ||||||
|
View the equivalent code in;
|
||||||||
| Prev: 56845 | Up: Map | Next: 56938 |