Prev: 41275 Up: Map Next: 41387
41356: 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 136 and is above the half-way point of the screen.
TestPlayerProgress 41356 LD A,(IX+1) Fetch the room of the player.
41359 CP 136 Jump to TestPlayerProgress_ShowAmulet if the player is not in room 136.
41361 JR NZ,TestPlayerProgress_ShowAmulet
41363 LD A,(IX+4) Fetch the Y position of the player.
41366 CP 128 Jump to TestPlayerProgress_ShowAmulet if the player has not reached the top half of the screen (the Y position is 128 or more).
41368 JR NC,TestPlayerProgress_ShowAmulet
The game is over, so discard the return address as GameComplete never returns to the caller.
41370 INC SP Discard the return address.
41371 INC SP
41372 JP GameComplete Jump to GameComplete to complete the game.
Show the amulet if a piece has just been collected.
TestPlayerProgress_ShowAmulet 41375 BIT 7,(IX+11) Return unless the "show the amulet" flag (bit 7 of the amulet pieces collected, see 38669) is set.
41379 RET Z
41380 RES 7,(IX+11) Reset the "show the amulet" flag as it has been dealt with.
41384 JP ShowAmulet Jump to ShowAmulet to show the amulet.
Prev: 41275 Up: Map Next: 41387