Prev: A13B Up: Map Next: A1AB
A18C: Test Player Progress
Used by the routines at PlayerMovement and GamePlay_Start.
Called once per frame for the player. Checks whether the game has been completed and whether an amulet piece has just been collected.
Input
IX Actor record of the player
The game is complete if the player is in room 88 and is above the half-way point of the screen.
TestPlayerProgress A18C LD A,(IX+$01) Fetch the room of the player.
A18F CP $88 Jump to TestPlayerProgress_ShowAmulet if the player is not in room 88.
A191 JR NZ,TestPlayerProgress_ShowAmulet
A193 LD A,(IX+$04) Fetch the Y position of the player.
A196 CP $80 Jump to TestPlayerProgress_ShowAmulet if the player has not reached the top half of the screen (the Y position is 80 or more).
A198 JR NC,TestPlayerProgress_ShowAmulet
The game is over, so discard the return address as GameComplete never returns to the caller.
A19A INC SP Discard the return address.
A19B INC SP
A19C JP GameComplete Jump to GameComplete to complete the game.
Show the amulet if a piece has just been collected.
TestPlayerProgress_ShowAmulet A19F BIT 7,(IX+$0B) Return unless the "show the amulet" flag (bit 7 of the amulet pieces collected, see 970D) is set.
A1A3 RET Z
A1A4 RES 7,(IX+$0B) Reset the "show the amulet" flag as it has been dealt with.
A1A8 JP ShowAmulet Jump to ShowAmulet to show the amulet.
Prev: A13B Up: Map Next: A1AB