Prev: 27697 Up: Map Next: 27736
27708: Next Level
Used by the routine at NextActor.
Moves on to the next level, when all of the ingredients for a level have been collected. Bits 0-2 of the level (ActivePlayer_Level) are the level within a set of five, and bits 3-5 are the set. After the fifth level of a set the cake is made; the level is moved on to the start of the next set, the player gets an extra life and 9472 (BCD) points, and the cake is started by StartCake. Otherwise the level is set up by SetUpLevel.
NextLevel 27708 LD HL,24365 Point HL at the level (ActivePlayer_Level).
27711 INC (HL) Increase the level by one.
27712 LD A,(HL) Fetch the level.
27713 AND %00000111 Keep only bits 0-2.
27715 CP 5 Jump to SetUpLevel if the set has not been finished.
27717 JR C,SetUpLevel
27719 LD A,(HL) Fetch the level.
27720 ADD A,3 Add 3 to get to the start of the next set.
27722 LD (HL),A Update the level.
27723 LD HL,24366 Point HL at the lives of the active player (ActivePlayer_Lives).
27726 INC (HL) Increase the number of lives by one.
27727 LD BC,9472 Set the bonus points for finishing a set to 9472 (in BCD).
27730 CALL AddPointsToScore Add the points to the score using AddPointsToScore.
27733 JP StartCake Jump to StartCake to start the cake.
Prev: 27697 Up: Map Next: 27736