Prev: 5F53 Up: Map Next: 5FA0
5F80: Initialise New Level
Used by the routines at StartGame and LevelComplete.
Starts a new level for the active player: refills the cubby holes, resets the flower and leaves, sets up the player and then draws the game window ready for the level to start.
new-level
Give the player a life, as PlayerInit is about to "spend" one.
LevelNew 5F80 LD HL,$5E38 Increment CurrentPlayer_Lives by one.
5F83 INC (HL)
Reset the cubby holes, the flower and the leaves, then set up the player.
5F84 CALL ResetCubbyHoles Call ResetCubbyHoles.
5F87 CALL ResetFlowerLeaf Call ResetFlowerLeaf.
5F8A CALL PlayerInit Call PlayerInit.
This entry point is used by the routine at PlayerTurnEnds.
Draw the game window; this entry point is also used to continue the game after a turn.
LevelInit 5F8D CALL CreateWindow Create the game window using CreateWindow.
5F90 CALL DrawPlayArea Draw the play area using DrawPlayArea.
5F93 CALL DrawCubbyHoleItems Draw the cubby hole items using DrawCubbyHoleItems.
5F96 CALL DisplayPlayerLives Display the lives using DisplayPlayerLives.
5F99 LD A,($5C78) Write FRAMES to LastFrame.
5F9C LD ($5E1F),A
5F9F RET Return.
View the equivalent code in;
Prev: 5F53 Up: Map Next: 5FA0