![]() |
Routines |
| Prev: 9DA9 | Up: Map | Next: 9DBB |
|
Used by the routines at ApplyCollisionEffects, ApplyPlayerCollision, CheckShotCollisions, CheckMapObjectCollisions, TestBoxAgainstShip and CheckTerrainCollision.
Tests whether a box overlaps another box. The first box is described by four bytes: the horizontal position of the left edge, the vertical position, the width and the height. The vertical test passes when the vertical position of the first box minus that of the second is less than the height of the first box, or when the vertical position of the second box minus that of the first is less than the height of the second box.
|
||||||||||||||||||||||
| TestBoxesOverlap | 9DB1 | CALL TestHorizontalOverlap | Test whether the boxes overlap horizontally. | |||||||||||||||||||
| 9DB4 | LD A,($5C1C) | Fetch the result. | ||||||||||||||||||||
| 9DB7 | AND A | Test it. | ||||||||||||||||||||
| 9DB8 | RET Z | Return if they do not. | ||||||||||||||||||||
| 9DB9 | JR TestVerticalOverlap | Jump to TestVerticalOverlap to test whether they overlap vertically. | ||||||||||||||||||||
| Prev: 9DA9 | Up: Map | Next: 9DBB |