Scratch Jr
Beginner
30 mins
Teacher led
What you need:
iPad/Tablet

Floating in Space: Looping with the Spaceman

As the teacher, guide your students through a Scratch Jr. lesson on coding loops. Introduce space movement concepts, help them set up a spaceman sprite with a space background, and demonstrate using repeat blocks for continuous floating motion.
Learning Goals Learning Outcomes Teacher Notes

Teacher Class Feed

Load previous activity

    1 - Introduction

    Welcome to today's exciting Scratch Jr. lesson! Your students are about to embark on a space adventure by programming a spaceman to float through the cosmos.

    This mission is designed to teach them one of the most powerful tools in coding: the repeat block (or loop). A loop allows a character to perform an action over and over without you having to manually input each step—perfect for simulating endless floating!

    Students will start by setting the scene: removing the default character and adding a spaceman to a space-themed background. They'll discuss how astronauts move in space, which requires continuous, small movements.

    They'll then program this movement by:

    1. Using a sequence of basic movement blocks to create a short "floating" motion.

    2. Adding the repeat block around that movement sequence to create an endless floating motion, simulating the weightlessness of space.

    This lesson will solidify their understanding of basic movement and introduce the crucial concept of loops in coding.

    2 - Space movement

    Start the lesson by introducing the idea of space exploration! Discuss with the students how astronauts move in space compared to how we move on Earth.

    Click on the picture to display the visual stimulus for discussion. Ask the students:

    • How do you think a spaceman would move? (Prompt for answers like floating, slowly, or smoothly).

    • What directions can they move in? (Up, down, left, right—not just forward on the ground!).

    This discussion is crucial, as the way astronauts move—floating, with slow, smooth motions—is exactly the sequence of movements they will need to program into Scratch Jr. for their spaceman.


    3 - Setting the Scene for Space

    Now that we've discussed how astronauts move, let's set the stage in Scratch Jr. for our space mission.


    1. Clear the Stage and Choose Your Astronaut

    Guide your students to open a new project and get ready for their new character:

    1. Open New Project: Tap the Home button, then tap the large plus icon (+) to start fresh.

    2. Remove the Cat: Since we're going to space, we need to remove the default character. Show students how to tap and hold on the Scratch the Cat sprite until the "X" appears, then tap the "X" to delete it.

    3. Add the Spaceman: Tap the plus icon (+) in the character area again to open the library. Guide them to browse through the characters and select a spaceman/astronaut sprite.

    2. Set the Space Background

    Next, have the students choose the environment for their spaceman:

    1. Tap the background icon (the small landscape picture) above the stage area.

    2. Browse through the options and select a space-themed background.

    Once the steps are complete, click on the picture to show the students what their screen should look like—a spaceman floating against the cosmos, ready to be coded!


    4 - Programming the Float Movement

    First, let's discuss how we translate our ideas about floating into code. Gather your students and encourage them to think about using the four directions—up, down, left, and right—to simulate the continuous, slow floating motion of an astronaut. Remind them they need small, smooth movements, not big jumps.


    Demonstration: The Floating Sequence

    Now, demonstrate how to build this basic "floating" sequence in Scratch Jr.

    1. Start the Program: Remind the students to drag the green flag block (the yellow start block) into the coding area.

    2. Build the Float: Show them how to add a sequence of movement blocks (the blue blocks) to create one short floating cycle. For example, your sequence could be:

      • One Up block

      • One Down block

      • One Left block

      • One Right block

    3. Test: Have them click the green flag to see their spaceman perform this short floating pattern.

    Click on the video to preview what this specific movement should look like. This sequence is the foundation for the continuous floating motion we will create next!


    5 - The Repeat Block

    Now it's time to make the spaceman float continuously! Tell your students you're going to introduce the repeat block, which is one of the most powerful ideas in coding.

    Explain that the repeat block (found in the Control category—the orange blocks) creates a loop. A loop makes the computer do the same thing over and over again without needing a long list of instructions. This is perfect for simulating the endless, weightless floating of space!


    Building the Loop

    1. Find the Block: Guide students to the orange repeat block.

    2. Encapsulate the Code: Show them how to place the repeat block around their existing floating sequence of movement blocks. (The repeat block should now be attached to the green flag, with the movement blocks tucked inside).

    3. Test the Program: Instruct the students to click the green flag to start their project and watch as the spaceman floats continuously in space.

    Click on the green flag to preview this smooth, endless floating movement. If the spaceman is moving too fast, encourage them to adjust the numbers on the movement blocks to slow down the motion!


    Unlock the Full Learning Experience

    Get ready to embark on an incredible learning journey! Get access to this lesson and hundreds more in our Digital Skills Curriculum.

    Copyright Notice
    This lesson is copyright of Coding Ireland 2017 - 2025. Unauthorised use, copying or distribution is not allowed.
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more