Prev: 57239 Up: Map Next: 57355
57338: Test Cell Moving Up
Used by the routine at TestMoveUp.
Tests an object that is moving up the screen (along the positive Y axis) against the walls in one cell. If the object hits a wall then its velocity along the Y axis is reduced by twice the depth that it has gone into the wall, and the flag for a collision is set.
Input
DE X position to test
HL Y position to test
IX Object
Output
F The carry flag is set if there was a collision
Check the walls, then push the object back if it is touching one.
TestCellMovingUp 57338 CALL CheckWallsHorizontalFirst Check whether the object hits a wall in the cell.
57341 RET NC Return if it did not.
This entry point is used by the routine at TestCellMovingDown.
Reduce the velocity along the Y axis.
ReduceVelocityY 57342 ADD A,A Double the depth.
57343 ADD A,(IX+11) Add it to the velocity along the Y axis, which stops the object at the wall.
57346 LD (IX+11),A
This entry point is used by the routine at TestCellMovingRight.
Set the flag for a collision.
SetCollisionFlag 57349 SET 0,(IX+7) Set the flag for a collision.
57353 SCF Set the carry flag and return.
57354 RET
Prev: 57239 Up: Map Next: 57355