The Scripts of Scratch Programming (Cont’d) Basic 6 Basic Technology Lesson Note

Download Lesson Note
Lesson Notes

Topic: 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:

  1. Start with Events 
    1. Every script needs a starting block
    2. Most common: “When green flag clicked”
  2. Use Control Blocks for Repetition 
    1. “Forever” for continuous action
    2. “Repeat” for specific number of times
    3. “If-then” for decisions
  3. Add Motion for Movement 
    1. Combine with Forever for continuous movement
    2. Use “glide” for smooth movement
  4. Make it Interactive 
    1. Use Sensing blocks to detect clicks, touches
    2. Use “Ask” blocks for user input
  5. Add Polish with Looks and Sound 
    1. Sound effects make projects more engaging
    2. 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:

  1. Check Block Order – Are blocks in right sequence?
  2. Look for Missing Blocks – Did you forget wait or repeat?
  3. Test One Part at a Time – Run small sections separately
  4. Check Values – Are numbers correct?
  5. Look at Variables – Are they set correctly?
  6. Watch the Stage – See what actually happens
  7. 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:

  1. Make sprite follow mouse
  2. Create color-changing background
  3. 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

Lesson Notes for Other Classes