Escape Room Program – Part 3: escaping the room

Step 4 – Making things harder

What if we want to make life harder for the player?

After all, this is the third riddle. It's the Boss Battle (sort of)

What if we only give them three lives to solve the riddle? That would be ... evil!

  1. Code helper imageStart by setting up a variable called lives and set it to 3

    Make sure you do this before the while loop starts

  2. Then add to the while loop line – we need to keep going whilst lives is greater than 0, so we can use:
    while move_on == False and lives > 0:

    This keeps looping all the time BOTH things are true. As soon as lives drops to 0 or move_on is True the loop will stop

  3. Add lines to take a life away:  lives = lives - 1
  4. Test it all works

You'll really need to test this out and figure out the best way to take lives away. You might be kind and start with more than 3. Or not...

Just make sure you keep the escape room interesting enough that the player doesn't get bored. The game has to be fair. Usually.