![]() |
Routines |
| Prev: 29282 | Up: Map | Next: 29477 |
|
Used by the routine at 25837.
|
||||||||||||||
| BugCollision | 29429 | LD HL,24172 | HL=State_Robbie_Active. | |||||||||||
| 29432 | LD E,0 | E=Default value 0 (no collision). | ||||||||||||
| 29434 | LD A,(HL) | A=State_Robbie_Active. | ||||||||||||
| 29435 | AND %00111111 | Keep only bits 0-5. | ||||||||||||
| 29437 | DEC A | Decrease A by one. | ||||||||||||
| 29438 | JR Z,BugCollision_X | If A is zero then jump to BugCollision_X. | ||||||||||||
| 29440 | DEC A | |||||||||||||
| 29441 | RET NZ | |||||||||||||
| BugCollision_X | 29442 | INC HL | A=State_Robbie_Pos_X. | |||||||||||
| 29443 | LD A,(HL) | |||||||||||||
| 29444 | SUB (IX+1) | Robbie X position - bug X Position. | ||||||||||||
| 29447 | JP P,BugCollision_Test_X | Make sure we have a positive byte. | ||||||||||||
| 29450 | NEG | |||||||||||||
| BugCollision_Test_X | 29452 | CP 16 | Return if A >= 16. | |||||||||||
| 29454 | RET NC | |||||||||||||
| 29455 | INC HL | A=State_Robbie_Pos_Y. | ||||||||||||
|
This entry point is used by the routine at 29282.
|
||||||||||||||
| BugCollision_0 | 29456 | LD A,(HL) | } | |||||||||||
| 29457 | SUB (IX+2) | Robbie Y position - bug Y position. | ||||||||||||
| 29460 | JP P,BugCollision_SetHeight | Set D to 18 if it's a positive number. | ||||||||||||
| 29463 | NEG | |||||||||||||
| 29465 | LD D,(IX+7) | D=bug sprite height. | ||||||||||||
| 29468 | JR BugCollision_Test_Y | Jump to BugCollision_Test_Y. | ||||||||||||
| BugCollision_SetHeight | 29470 | LD D,18 | D=18. | |||||||||||
| BugCollision_Test_Y | 29472 | CP D | Return if D >= A. | |||||||||||
| 29473 | RET NC | |||||||||||||
|
A collision has been detected.
|
||||||||||||||
| 29474 | LD E,1 | E=1. | ||||||||||||
| 29476 | RET | Return. | ||||||||||||
| Prev: 29282 | Up: Map | Next: 29477 |