![]() |
Routines |
| Prev: C52F | Up: Map | Next: C554 |
|
Checks whether the object at IX has been hit by a shot. The shots are objects of type 50 to 5F. The first shot is checked twice, as IY is not moved on to the second.
|
||||||||||||||
| CheckShotHit | C538 | LD IY,$BCAE | Point IY at the first shot, and set a counter for two shots. | |||||||||||
| C53C | LD B,$02 | |||||||||||||
| CheckShotHit_Loop | C53E | PUSH BC | Check whether this shot hits the object, and return if it does. | |||||||||||
| C53F | CALL CheckShotHit_Shot | |||||||||||||
| C542 | POP BC | |||||||||||||
| C543 | RET C | |||||||||||||
| C544 | LD DE,$0010 | Set the distance from one object to the next (10 bytes). | ||||||||||||
| C547 | DJNZ CheckShotHit_Loop | Loop back until both shots have been checked. | ||||||||||||
| C549 | RET | Return. | ||||||||||||
| CheckShotHit_Shot | C54A | LD A,(IY+$00) | Return if the object at IY is not a shot (type 50 to 5F). | |||||||||||
| C54D | SUB $50 | |||||||||||||
| C54F | CP $10 | |||||||||||||
| C551 | RET NC | |||||||||||||
| C552 | JR CheckObjectsOverlap | Jump to CheckObjectsOverlap to check whether the shot overlaps the object. | ||||||||||||
| Prev: C52F | Up: Map | Next: C554 |