The Secret Level
Somewhere in the game, there's a secret level. It unlocks when you've found the golden key, or when you've collected every coin in the level and finished it in less than 60 seconds. Two new constants hold what you need for that: coinsInLevel is the number of coins in the whole level, and hasKey is true if you've found the key.
At the end, the program prints one more line: Secret level: unlocked or Secret level: locked. You haven't found the key, and you've missed 3 of the 40 coins, so the output ends like this:
Stars: 2 of 3
High score: 900
Secret level: lockedThe exercise checks the program with other data too, so make sure it's right in every case: with the key, the secret level unlocks whatever your score; with all 40 coins in 55 seconds, it unlocks too; with all 40 coins in 85 seconds, it stays locked.
That's the whole project. With just two lessons behind you, you've written the end screen of a game: it calculates with constants and variables, makes decisions with conditions and prints a clear report with template literals. In the next lesson, you'll learn about arrays, which hold many values in one variable, such as the scores of all your levels.
Instructions
Print whether the secret level is unlocked. With the values in the program, the last line is Secret level: locked.
Start programming for free
3/3