In this lesson, we are going to explore some of the coding concepts for the Wildfire tracking robot you are going to code in the next lesson Take a look at the blocks below and their function, they will be used to code your project in the next section.

Forever Loop

In coding, there’s a block called the ‘Forever’ block. Imagine you have a toy train that goes around a track. Once you turn it on, it keeps going around and around until you decide to turn it off. That’s how the ‘Forever’ block works in coding. It tells the computer to keep doing something over and over again without stopping.

For example, in a video game, you might have a background with clouds that keep moving across the screen. Instead of telling the computer to move the clouds just once, you’d use the ‘Forever’ block to make the clouds move continuously, creating the illusion that they’re floating by endlessly. So, the ‘Forever’ block is like turning on that toy train, making sure the action keeps going until we choose to stop it!

If/Then Statement

In coding, we have a super handy tool called the ‘If, Then, Else’ block. Imagine you’re giving advice to a friend about dressing up for the day. You’d say, ‘If it’s sunny, wear your cool shades and shorts. But if it’s not sunny, maybe it’s raining, so wear your raincoat and boots instead.’ This ‘If, Then, Else’ block is like that advice. It helps the computer make decisions by giving it two choices: one for when something specific happens (like it being sunny) and another choice for when it doesn’t. Just like you pick your outfit based on the weather, the computer picks an action based on the rules we give it!

“On Dial Turned”

In coding, it’s important to decide when certain things happen. Think of it like a magic button. There’s a special piece of code called ‘key() pressed’ that’s like our magic button. It’s always waiting, or ‘listening,’ for you to press a certain key on your keyboard.

Imagine it’s like a light switch: it can be either ON or OFF. In coding, we call this TRUE (for ON) and FALSE (for OFF). If you press the special key, the ‘key() pressed’ code turns ON (or TRUE), and something fun might happen in a game, like your character jumping! If you don’t press the key, it stays OFF (or FALSE), and nothing happens.

Variables

In coding, we often need to remember or keep track of certain pieces of information. We use something called a ‘variable’ to do this. Imagine a variable as a special kind of backpack. Inside the backpack, you can put different items, and you can also take them out or change them. Just like you might put a book in your backpack today and a lunchbox tomorrow, a variable can hold different data at different times. So, a variable is like a computer’s backpack, helping it remember and carry the information you give it!