Routines |
Prev: 53625 | Up: Map | Next: 53759 |
Used by the routine at 51359.
|
||||
Check for collisions with all tunnel objects (left/right boundary, bats or spiders).
|
||||
53714 | LD A,(60238) | Object properties byte | ||
53717 | AND 1 | Bit 1 indicates if the item is visible on-screen | ||
53719 | JR Z,53787 | If not, skip the rest of this routine | ||
Check what tunnel object we're dealing with:
|
||||
53721 | LD A,(60230) | Tunnel boundary wall type. 1 = right, 2 = left | ||
53724 | CP 1 | |||
53726 | JR Z,53819 | Right boundary wall check | ||
53728 | CP 2 | |||
53730 | JR Z,53840 | Left boundary wall check | ||
If it's not a right/left boundary wall, the item must be a creature - spider or bat.
In which case, run a collision check with Maroc and reduce his energy if a collision is detected.
|
||||
53732 | LD A,2 | Set the counter/length/frequency used for the generic sound effect routine at 49274 as spiders and bats make a scuttling/flapping sound as they move down the tunnel | ||
53734 | LD (60246),A | |||
53737 | LD C,0 | Collision/event type to check - 0 = Collision with Maroc | ||
53739 | CALL 57293 | Run event/collision check | ||
53742 | CP 0 | The A register is returned with 1 = Collision, 0 = No collision | ||
53744 | JR Z,53751 | |||
53746 | LD A,16 | If there's a collision... | ||
53748 | CALL 58316 | ...Reduce Maroc's energy (by 16) | ||
Creature movement
|
||||
53751 | LD A,(60230) | Creature type. 4 = Spider, 8 = Bat | ||
53754 | CP 8 | Is it a bat? | ||
53756 | JP NZ,53885 | If not, jump to spider movement |
Prev: 53625 | Up: Map | Next: 53759 |