Creative Coding Studio · Lesson 5

Studio build: give the program a decision

Ākonga implement an if-then that changes what the sprite does, then deliberately test both branches rather than assuming the untested one works.

Other teaching approach: Unplugged Computational Thinking Seminar →
Year 7 Digital Technology · Computational Thinking

Lesson 5: Conditional Logic: Making Decisions with 'If-Then-Else'

Developing computational thinking through Scratch block coding, algorithms, and Te Ao Māori perspectives.

🎯 Ngā Whāinga Akoranga | Learning Intentions

🧠 Students will know:

Selection and conditional logic (If-Then, If-Then-Else), boolean logic statements (true/false conditions), and sensing collision triggers.

✏️ Students will demonstrate:

Construct scripts using conditional blocks to trigger actions when sprites touch colours, edge boundaries, or mouse cursors.

🎥 Media Anchor & Pedagogical Scaffold

Scratch Basics: Conditional Statements

Video Clip: A clear beginner tutorial on if-then and if-then-else blocks in Scratch — how Boolean conditions work, and how to branch your code based on what is true.

🧠 1. Before Viewing (Activate & Predict)

How does a game know when a player has touched a coin to gain a point, or touched a lava hazard to lose a life?

👁️ 2. During Viewing (Watch With a Job)

  • Watch the full clip and identify the shape of Boolean condition blocks in Scratch — why are they hexagon-shaped instead of rectangular?
  • Notice the difference between if-then (one outcome) and if-then-else (two outcomes) — when would you choose each?
  • After watching, add a conditional to a sprite in your project so it reacts when it touches another sprite or a specific colour.

🗣️ 3. After Viewing & Kaiako Move (Process & Apply)

Kaiako Move: Demonstrate a maze game script where touching black walls resets sprite position to the start coordinates.

Immediate Task: Complete Section 5 of your Digital Tech Logbook: Conditional Logic Flowchart & Maze Collision Code.

⚡ Whakaoho | Do Now: If-Then Walk to School (10 mins)

On paper, write one "if… then… otherwise…" sentence about your walk to school — for example, "if it is raining, then take the covered walkway, otherwise take the field". Today you translate exactly that structure into blocks Scratch can execute.

📖 Activity 1: The Boundary Maze — Make the Condition True on Purpose (25 mins)

Build the boundary maze with the projector: if <touching colour black?> then go to x:-180 y:0 resets the sprite to the start. Deliberately drive into a wall and watch the condition flip to true — then deliberately stay on the path and watch it never fire. Pairs add the else branch (a bounce, or a "try again" sound) and one win condition of their own design, then prove both branches run: one clean run, one deliberate crash.

📝 Activity 2: Digital Tech Logbook & Code Reflection (20 mins)

Draft your formal Digital Tech Logbook entry for Lesson 5. Apply exact programming vocabulary (e.g., condition, if-then-else, true, false, branch, boundary) to explain your code decisions.

🏫 Kaiako Planning & Pedagogy Notes

Year 7 Curriculum Alignment: Conditional logic with if-then-else (NZC Technology; Te Mātaiaho Phase 3) — Lesson 4's stored variables become the conditions scripts test.