Introduction to Scratch & Coding

Setting Up the Project

Start by choosing a space background to make the scene look exciting. Add a star sprite from the sprite library.

Understanding Gliding Movement

What is Gliding?

Gliding means moving smoothly from one position to another.

Coding the Star to Glide

  • Go to Events → drag when green flag clicked
  • Go to Motion → choose glide 1 sec to random position
  • This makes the star glide to any random spot on the stage.

For continuous movement:

  • Go to Control → drag forever loop
  • Place the glide block inside it

→ The star now glides forever until you press stop.

Moving a Robot Sprite Left and Right

Add a robot sprite.

Coding Movement

  • Add when green flag clicked
  • Go to Motionmove 10 steps
  • Put the move block inside a forever loop

→ Robot moves continuously.

Handling Edges

Robots may reach the edge and get stuck or flip upside down. To fix this:

  • Go to Motionif on edge, bounce → makes robot bounce back when touching edges
  • Go to Motionset rotation style left-right → prevents robot from flipping upside down

→ Robot now moves back and forth neatly.

Spinning a Planet

Add a planet sprite.

Making It Rotate

  • Add when green flag clicked
  • Go to Motionturn 15 degrees
  • Place inside a forever loop
  • Optional: Change 15 degrees to control speed
    • Low number = slow spin
    • High number = fast spin

Teleport Movement

Add any new sprite (your choice).

Coding Teleport Effect

  • Add when green flag clicked
  • Go to Motiongo to random position
  • Put inside a forever loop

→ Sprite teleports very fast and looks messy.

Slowing Down the Teleporting

  • Add wait 1 second inside the loop

→ Teleports every second, looking smooth and controlled.

Summary of Movement Types Learned

  • Glide movement: smooth movement
  • Step movement: robot moves step-by-step
  • Bounce movement: bounce off edges
  • Rotation movement: planet spins
  • Teleport movement: appears in random positions

Assignment

Choose a theme:

  • Space
  • Underwater
  • Forest
  • Candyland
  • City

Add at least 3 sprites and use different types of motion blocks to make your own animation.