Prev: 6C31 Up: Map Next: 6C58
6C3C: 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 2500 (BCD) points, and the cake is started by StartCake. Otherwise the level is set up by SetUpLevel.
NextLevel 6C3C LD HL,$5F2D Point HL at the level (ActivePlayer_Level).
6C3F INC (HL) Increase the level by one.
6C40 LD A,(HL) Fetch the level.
6C41 AND %00000111 Keep only bits 0-2.
6C43 CP $05 Jump to SetUpLevel if the set has not been finished.
6C45 JR C,SetUpLevel
6C47 LD A,(HL) Fetch the level.
6C48 ADD A,$03 Add 03 to get to the start of the next set.
6C4A LD (HL),A Update the level.
6C4B LD HL,$5F2E Point HL at the lives of the active player (ActivePlayer_Lives).
6C4E INC (HL) Increase the number of lives by one.
6C4F LD BC,$2500 Set the bonus points for finishing a set to 2500 (in BCD).
6C52 CALL AddPointsToScore Add the points to the score using AddPointsToScore.
6C55 JP StartCake Jump to StartCake to start the cake.
Prev: 6C31 Up: Map Next: 6C58