What are Booleans?
If you remember, we did discuss Booleans before. In lesson five, we discussed data types and Boolean was an example. Remember, the Boolean data type had two values: true or false. We often use Boolean algebra computer programming as well. In the last lesson, we started to use conditional statements even more in our game.
An example of this was: "If currentlevel = 1 then". When we ask the program to compare two values, e.g. "0=0" or "0>0", this is called a Boolean expression. So as part of our conditionals, we are using Boolean expressions also which allow us to establish if our program should execute a command or not. Who knew you were doing so much code?!
In exploring today's lesson, we will continue to add to this and build on our understanding of conditions and Booleans. Let’s get going!
For your home challenge, we want you to be creative and add a final element to your game. For example, a "danger box" that plays a role in how the game progresses. Or maybe even a "danger box" that sends you back to level one! Use the planning sheets here to brainstorm and then use your knowledge of tilemaps and overlaps to help you implement this in your code.