| Ant Attack | Routines |
| Prev: 8F7A | Up: Map | Next: 8FCC |
|
Used by the routine at GAME_FRAME.
Waiting, they drive the scanner, and are found when the player comes within three cells at the same height: "MY HERO!". After that they follow the player.
|
||||
| MOVE_RESCUEE | 8F80 | LD IX,RESCUEE | ||
| 8F84 | LD IY,PLAYER | |||
| 8F88 | LD A,(IX+$0D) | Found yet? | ||
| 8F8B | AND A | |||
| 8F8C | JR Z,MOVE_RESCUEE_0 | |||
| 8F8E | CALL SHARE_CELL | Following: stand clear, follow, move, animate. | ||
| 8F91 | CALL FOLLOW_PLAYER | |||
| 8F94 | CALL MOVE_OR_RESPAWN | |||
| 8F97 | CALL CHOOSE_FRAME | |||
| 8F9A | RET | |||
| MOVE_RESCUEE_0 | 8F9B | LD L,(IX+$00) | Waiting: how far is the player? | |
| 8F9E | LD H,(IX+$01) | |||
| 8FA1 | LD E,(IY+$00) | |||
| 8FA4 | LD D,(IY+$01) | |||
| 8FA7 | CALL DISTANCE | |||
| 8FAA | LD C,A | |||
| 8FAB | CP (IX+$0E) | Green if closer than last frame. | ||
| 8FAE | LD (IX+$0E),A | |||
| 8FB1 | CALL SCANNER | |||
| 8FB4 | LD A,C | Within three cells at the same height... | ||
| 8FB5 | CP $04 | |||
| 8FB7 | RET NC | |||
| 8FB8 | LD A,(IX+$02) | |||
| 8FBB | CP (IY+$02) | |||
| 8FBE | RET NZ | |||
| 8FBF | LD (IX+$0D),$01 | ...found: "MY HERO!". The scanner goes red, the flags left from the height comparison. | ||
| 8FC3 | CALL SCANNER | |||
| 8FC6 | LD A,$0C | |||
| 8FC8 | CALL PLAY_SCRIPT | |||
| 8FCB | RET | |||
| Prev: 8F7A | Up: Map | Next: 8FCC |