Understanding Loops in Scratch Junior!

Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape

Get ready to take your ScratchJr projects to the next level! Today, we’re exploring the amazing concept of loops and how they can make your animations more efficient and fun.

Loops are like a secret shortcut that allows you to repeat actions without doing them over and over again. They can be used to create patterns, animations, and repeated movements. Loops save time by letting your characters perform tasks automatically and bring your ideas to life with creative and engaging sequences.

We can use loops to create smooth and exciting animations effortlessly. Let’s jump in and see what we can create together—because in Scratch Jr., the possibilities are endless!

Loops are a fundamental concept in programming and can be introduced effectively using Scratch Junior

We can get started by knowing what is loops in ScratchJr:

What Are Loops?

When you’re on a swing, you pump your legs forward and backward repeatedly to keep swinging.

  • This is a loop of movement that continues until you stop.

This is called repeating or looping. A loop is a way to repeat a set of instructions multiple times. 

They’re super useful when you want something to keep happening, like a character running, flying, or moving around in circles.

Types of Loops in Scratch Jr.

1. Repeat Loop

  • Purpose: The repeat loop allows you to repeat a sequence of actions a specific number of times.
  • Appearance: An orange block with a left curved arrow and a number input field inside.
  • How It Works:
    • Place blocks (motion, looks, or sound) inside the repeat block.
    • Specify the number of repetitions by tapping on the number in the block.
    • The actions inside the repeat block will execute the specified number of times.
Example Use Case:
Bouncing Ball:
  • Use the repeat loop to make a ball bounce 5 times.
  • Code: Add a “move up” block, a “move down” block, and wrap them inside a repeat loop with the number set to 5.
Animation of a ball bouncing repeatedly on a surface.

2. Forever Loops (Workaround)

  • Purpose: The forever loop repeats a sequence of actions endlessly, continuing until the program is stopped.
  • Appearance: A red block with a circular arrow symbol and no number input field.
  • How It Works:
    • Place blocks before the forever loop, and the actions will repeat continuously.
    • Combine the forever loop with event triggers like “when tapped” or “start on green flag” to start the infinite loop.
Example Use Case:
Flying Bird:
  • Use the forever loop to make a bird fly continuously.
  • Code: Add a “move right” block in between a forever loop and an event trigger to make the bird fly.
Animation of a bird flying across the screen in Scratch Jr.

Comparison of Repeat and Forever Loops

Feature

Repeat Loop

Forever Loop

Repetition Limit

Repeats a set number of times.

Repeats actions endlessly.

Use Case

For specific, countable repetitions.

For continuous, ongoing actions.

Customization

Number of repetitions is adjustable.

Runs until manually stopped.

Example

Jumping 3 times.

Animating a bird flying forever.

× We're here to help!