The Scripts of Scratch Programming (Cont’d) Basic 6 Basic Technology Lesson Note
Download Lesson NoteTopic: The Scripts of Scratch Programming (Cont’d)
Learning Objectives
By the end of the lesson, pupils should be able to:
- Identify the different scripts of the scratch interface
- Create simple programs using multiple block categories
Content
Review of Scratch Block Categories
This lesson continues exploring Scratch scripts with more detailed examples and practice.
CREATING COMPLETE PROJECTS
Project 1: Moving Cat Objective: Make the cat move across the screen
Script:
When green flag clicked (Events – Yellow)
Forever (Control – Orange)
  Move 10 steps (Motion – Blue)
  If on edge, bounce (Motion – Blue)
End Forever
What it does: Cat moves continuously and bounces when it hits the edge
Project 2: Color-Changing Sprite Objective: Make sprite change colors when clicked
Script:
When this sprite clicked (Events – Yellow)
Change color effect by 25 (Looks – Purple)
Play sound “pop” (Sound – Pink)
What it does: Each click changes color and plays sound
Project 3: Interactive Quiz Objective: Ask a question and check the answer
Script:
When green flag clicked (Events – Yellow)
Ask “What is 5 + 3?” and wait (Sensing – Light Blue)
If answer = 8 then (Control + Operators)
  Say “Correct! Well done!” for 2 seconds (Looks – Purple)
Else
  Say “Try again!” for 2 seconds (Looks – Purple)
End If
What it does: Asks math question and responds based on answer
Project 4: Dancing Sprite Objective: Make sprite dance to music
Script:
When space key pressed (Events – Yellow)
Play sound “dance music” (Sound – Pink)
Repeat 10 (Control – Orange)
  Next costume (Looks – Purple)
  Wait 0.3 seconds (Control – Orange)
End Repeat
What it does: When space bar pressed, sprite changes costumes (dances) to music
Project 5: Score Counter Objective: Count points when sprite is clicked
Script:
When green flag clicked (Events – Yellow)
Set score to 0 (Variables – Orange/Red)
Forever (Control – Orange)
  If touching mouse-pointer? then (Control + Sensing)
    Change score by 1 (Variables – Orange/Red)
    Play sound “coin” (Sound – Pink)
  End If
End Forever
What it does: Score increases each time sprite touches mouse
COMBINING BLOCKS EFFECTIVELY
Tips for Better Scripts:
- Start with Events
- Every script needs a starting block
- Most common: “When green flag clicked”
- Use Control Blocks for Repetition
- “Forever” for continuous action
- “Repeat” for specific number of times
- “If-then” for decisions
- Add Motion for Movement
- Combine with Forever for continuous movement
- Use “glide” for smooth movement
- Make it Interactive
- Use Sensing blocks to detect clicks, touches
- Use “Ask” blocks for user input
- Add Polish with Looks and Sound
- Sound effects make projects more engaging
- Visual changes (costumes, effects) add interest
COMMON SCRIPT PATTERNS
Pattern 1: Continuous Animation
When green flag clicked
Forever
  Next costume
  Wait 0.1 seconds
Use: Walking, flying, swimming animations
Pattern 2: Keyboard Control
When green flag clicked
Forever
  If key right arrow pressed? then
    Change x by 10
  End if
  If key left arrow pressed? then
    Change x by -10
  End if
Use: Player-controlled movement
Pattern 3: Random Behavior
When green flag clicked
Forever
  Go to random position
  Wait 1 second
Use: Unpredictable movement, games
Pattern 4: Clone Effect
When I start as a clone
Show
Wait 2 seconds
Delete this clone
Use: Creating multiple copies (stars, bubbles)
DEBUGGING TIPS
When your script doesn’t work:
- Check Block Order – Are blocks in right sequence?
- Look for Missing Blocks – Did you forget wait or repeat?
- Test One Part at a Time – Run small sections separately
- Check Values – Are numbers correct?
- Look at Variables – Are they set correctly?
- Watch the Stage – See what actually happens
- Use Say Blocks – Display values to check what’s happening
Common Mistakes:
- Forgetting “Forever” for continuous action
- Using wrong coordinate values
- Not waiting between costume changes (too fast)
- Missing “If” condition
- Wrong order of blocks
PROJECT IDEAS TO PRACTICE
Beginner:
- Make sprite follow mouse
- Create color-changing background
- Make sprite grow and shrink
Intermediate: 4. Simple catch game (catch falling objects) 5. Quiz game with multiple questions 6. Animated story with talking sprites
Advanced: 7. Maze game with collision detection 8. Score-based game with timer 9. Multi-level game
Activities
- Build each example project
- Modify projects by changing values
- Create own project using at least 4 block categories
- Debug intentionally broken scripts
- Share and test classmates’ projects
- Design a simple game plan using different scripts