Computer Science Grade 7 20 min

Introduction to Scratch Jr

Introduction to Scratch Jr

Tutorial Preview

1

Introduction & Learning Objectives

Learning Objectives Design a multi-page (multi-scene) project with clear navigation. Implement message passing to coordinate actions between two or more sprites. Use 'Start on Bump' and 'Start on Message' triggers to create event-driven interactions. Create a simple function-like behavior by having one sprite send a message that triggers a script on another sprite. Synchronize sprite movements and actions using a combination of messages and wait blocks. Debug a simple program by tracing the flow of messages between sprites and across pages. Ever wondered how characters in a video game know when to talk to each other or how you move from one level to the next? 🤔 Let's learn how to make our sprites communicate and travel! In this chapter, we'll...
2

Key Concepts & Vocabulary

TermDefinitionExample Message PassingA way for sprites to communicate with each other without touching. One sprite sends a colored message (like an envelope), and any other sprite with a matching 'Start on Message' block will run its script.A Cat sprite sends an orange message. A Dog sprite, which has a 'Start on Orange Message' block, will then jump and bark. Pages (Scenes)Separate backgrounds or stages within a single project. Sprites can be programmed to move the story or game to a new page.Page 1 is a forest. When the character reaches a castle door, the program switches to Page 2, which is the inside of the castle. Event-Driven ProgrammingA programming model where the flow of the program is determined by events, such as a user click, a message being received, or t...
3

Core Syntax & Patterns

The Message Passing Pattern Send Message (Color) -> Receive Message (Same Color) Use this pattern to create a cause-and-effect relationship between sprites. One sprite's script ends with a 'Send Message' block. A second sprite has a separate script that begins with a 'Start on Message' block of the same color. This decouples the sprites, allowing for more complex and organized code. The Page Navigation Pattern Trigger Event -> Go to Page [Number] Use this pattern to move between scenes in your project. A trigger event (like a sprite bumping into an object or the end of an animation) is followed by the 'Go to Page' block from the Red 'End' blocks category. This is essential for creating stories with multiple parts or games wi...

4 more steps in this tutorial

Sign up free to access the complete tutorial with worked examples and practice.

Sign Up Free to Continue

Sample Practice Questions

Challenging
You are designing a two-player game. Player 1 (P1) moves and then Player 2 (P2) moves. This turn-based system needs to repeat. What combination of messages would create a stable loop for taking turns?
A.P1: `[Start on Tap] -> [Move] -> [Send Red Message]`. P2: `[Start on Message (Red)] -> [Move]`
B.P1: `[Start on Message (Blue)] -> [Move] -> [Send Red Message]`. P2: `[Start on Message (Red)] -> [Move] -> [Send Blue Message]`
C.P1: `[Start on Green Flag] -> [Move]`. P2: `[Start on Green Flag] -> [Wait 10] -> [Move]`
D.Both players have a `[Start on Tap] -> [Move]` script.
Challenging
A complex animation requires a Cat to run across the screen, then a Dog to jump, and finally a Bird to sing. To ensure the smoothest, most reliable synchronization, what is the best approach?
A.Use one long script on the Cat sprite that controls the Dog and Bird with messages, but has no 'Wait' blocks to make it fast.
B.Start all three actions on the Green Flag and use carefully calculated 'Wait' blocks for the Dog and Bird.
C.Chain the events: Cat's script ends by sending a message to the Dog. The Dog's script ends by sending a message to the Bird. Use 'Wait' blocks within each script to fine-tune the timing of the animation itself.
D.Put all three actions on a single timeline using a 'Repeat' block.
Challenging
Compare using `[Start on Bump]` for collision detection versus a manual approach where a sprite moves, and a script continuously checks if its coordinates are near another sprite, then sends a message. What is a key advantage of using the built-in `[Start on Bump]` event?
A.The manual coordinate-checking method is always more accurate.
B.`[Start on Bump]` is a form of event-driven programming that is simpler to implement and more efficient for the computer than running a constant check.
C.`[Start on Bump]` allows you to detect collisions from farther away.
D.There is no functional difference between the two methods.

Want to practice and check your answers?

Sign up to access all questions with instant feedback, explanations, and progress tracking.

Start Practicing Free

More from Advanced Topics

Ready to find your learning gaps?

Take a free diagnostic test and get a personalized learning plan in minutes.