![]() |
Routines |
| Prev: 50485 | Up: Map | Next: 50622 |
|
Used by the routines at TestObjectIntersections, TestNearObject, BlockMovementInX, BlockMovementInY and BlockMovementInZ.
Tests whether two objects overlap along x, once the first has moved by its new speed along x. They overlap when the distance between the x positions is smaller than the two widths added together.
|
||||||||||||||||
|
Compare the x distance with the widths.
|
||||||||||||||||
| TestOverlapInX | 50601 | LD A,(IX+4) | Fetch the width of the first object. | |||||||||||||
| 50604 | ADD A,(IY+4) | Add the width of the second object. | ||||||||||||||
| 50607 | LD D,A | Copy the total to D. | ||||||||||||||
| 50608 | LD A,(IX+1) | Fetch the x position of the first object. | ||||||||||||||
| 50611 | ADD A,C | Add C. | ||||||||||||||
| 50612 | SUB (IY+1) | Subtract the x position of the second object. | ||||||||||||||
| 50615 | JP P,TestOverlapInX_Compare | Jump to TestOverlapInX_Compare if the sign flag is clear. | ||||||||||||||
| 50618 | NEG | Negate A. | ||||||||||||||
| TestOverlapInX_Compare | 50620 | SUB D | Subtract D. | |||||||||||||
| 50621 | RET | Return. | ||||||||||||||
|
View the equivalent code in;
|
||||||||||||||||
| Prev: 50485 | Up: Map | Next: 50622 |