Part 1 · Warm Up: Read the Code
🎯 Today I can…
Through a code review, word cards, a score demo, the Code.org levels, the Scoreboard Builder and a bug hunt, you will be able to:
- show a variable on the screen with a chosen starting value.
- change a variable by a positive or a negative number when an event happens.
- check for a winning score with a conditional, so an action runs only when the condition is true.
📦 Variable
Stores information (data). The value can change while the program runs.
❓ Condition
Something a program checks to see whether it is true before it takes an action.
🚦 Conditional
A chunk of code that only runs if the condition is true.
📖 Code review: a game with a unicorn
Read the code one line at a time. Point to each block as you read. Each block has a number.
🏷 Label the code
Which block does each job? Tap a block number for each one. Then press Check my labels.
💬 How do you play this game? How do you win or lose?
👆 Tap to finish the sentences.
Part 2 · Today’s Vocabulary
Tap each card to flip it. Read the meaning and the example, then flip it back and say the meaning in your own words.
Orange cards are extra words you will see on the Sprite Lab screen today.
Part 3 · Keeping Score with a Variable
📦 A variable is like a box with a label
The label is the name, like score. The box holds information, like the number 0. The information inside the box can change while the game is played.
- Show the variable. show variable score at 📍 puts the name and the value on the screen.
- Set the variable. set score to 0 gives the starting value.
- Change the variable. change score by 1 adds to the value. A negative number, like -1, takes away.
- Check the value. if score = 5 checks if the condition is true. If it is true, it runs the code inside.
Choose the blocks
The program
Predict, then test
Choose your prediction. Then set the blocks above, press Run and click the coin to test it before you press Check.
Part 4 · Variables as Score on Code.org
Goal: Add a variable to keep track of the score as it changes. Then check for a winning score.
Follow the instructions on each level, finish it, then tick the box. Read the hints and the feedback.
- Level 1: try one of the games. How does the scoring work? Then click Finish.
- Level 7 and Level 10: drag each piece of code to the matching animation, then click Submit.
- Level 11: these games do not work! Choose one game and fix it.
- Level 12: free play. Design your own game with a score or health variable and a winning or losing condition.
Sign in to Code.org with your class login first. Open the whole lesson on Code.org ↗
🙋 Stuck?
- Click the light bulb for a hint.
- Read the feedback in the yellow box under the instructions.
- Look back at Part 3 for show, set, change and if.
- Ask your partner, then use 🙋 I need help.
📶 Code.org will not load?
Tell Mr. EdLo straight away. Part 5: Scoreboard Builder works without the internet. It is always open, so tap it in the part buttons and practise there while you wait.
Part 5 · Scoreboard Builder and Bug Hunt
Build a small game with a coin and a bomb. Choose what each click changes, then press ▶ Run and click the sprites. Finish all 4 challenges. Then fix the 4 broken games in the Bug Hunt.
🏆 Challenges
My program
🐞 Bug Hunt: these games do not work!
Read each program and the problem. Choose the best fix, then press Check.
Part 6 · Wrap Up: Read a Game with Two Variables
🧩 Look carefully at this game and the code that made it
1. Explain the variables. 👆 Tap to finish the sentences.
2. Look back at today’s three goals. How did it go?
3. ✏️ Type ONE short sentence: what did you make change in a game today?
Example: “I made the score go up by 1 when I click the coin.”
Part 7 · Lesson Quiz
10 questions · You need 7 out of 10 (70%) to pass. If you do not pass, review the lesson parts named in your feedback and try again. Every attempt goes to Mr. EdLo’s record book.