The objective of the game is to make sure we are able to complete level 3 having picked all the keys. You are required to code the logic that will allow the rules to apply as so:
- Crystals: we should make sure all the crystals are picked in a level before we enable the yellow doors.
- Yellow doors: Provide access to the section that is locked from normal game play, but allow us to access the key that will allow the main level exit door to function.
- The level exit door: Allow us to move to Stage 2 and Stage 3. The door is only to be activated if the level's key is picked.
- Each time a new stage begins, the exit and yellow doors are de-activated.
- The player can collect crystals. The crystals should unlock the yellow doors.
- The yellow doors should be used to then access the key, that should enable the level exit door.
- The player can access each yellow door from each side. The yellow door transports the player character to and from the key's location (back and forth).
There are 2 major functions you can use to activate yellow doors and the exit door:
setExitDoorActive(true | false);
setYellowDoorsActive(true | false);
The following functions should be implemented to respond to events during game play:
crystalPicked(totalNumCrystals)
- ThetotalNumCrystals
will denote how many crystals in total there are in the current level / room.keyPicked()
- Invoked when a key is picked by the player.roomChanged()
- Invoked when a new stage is loaded / re-loaded (when the game room changes).