Are you ready to make your ScratchJr stories even bigger and better? Up until now, we’ve focused on single-scene projects, but today we’re going to learn how to move our characters from one scene to a completely new one using the Go To Page block. This is a fantastic way to create longer narratives and animations!
Our story for this project is a simple journey: Kitten moving from their classroom to the library.
Setting Up Your Multi-Page Project
To use the Go To Page block, you must first create a new page for your character to travel to.
1. Create the First Page (The Classroom)
- Change the Background: Start by selecting the classroom background for your first page. [00:27]
- Position Kitten: Move the Kitten character down to the floor, so they aren’t walking on the desk! [01:01]
2. Add the Second Page (The Library)
- Add New Page: Look to the far right of the screen and press the Add Page button (it has a plus symbol). [00:40]
- Select New Background: Choose the library background for this new page. [00:40]
- Position Kitten: Importantly, also move the Kitten character down to the floor on this new page so the transition looks smooth. [01:01]
Now you have a multi-page programme! You can see both pages at the top of your screen: the classroom (Page 1) and the library (Page 2).
Coding the Journey: Using the Go To Page Block
We only need to code the movement on the first page (the classroom), as the Go To Page block will handle the transition to the second page.
- Start the Programme: Go to the yellow category and drag the Green Flag trigger block into the programming area. [01:18]
- Make Kitten Move: Go to the blue Motion category and select the Move Right block. We want Kitten to move right across the entire screen and off the edge. You can use the grid to help you calculate the distance. [01:24]
- Tip for Distance: The video suggests setting the distance to 10 or 20 so the movement is clear. Let’s start Kitten in the middle (position 10) and set the move distance to 10 to make them walk right off the edge of the page. [02:17]
- Use the Transition Block: Now, instead of ending with a regular stop block, we go to the red End category and choose the Go To Page block (it looks like a right arrow pointing to a page). [01:36]
- Select the Destination: Inside the Go To Page block, make sure Page 2 is selected, which is our library. If you had more pages, you could change the destination here.
Running Your Multi-Page Story
Press the Green Flag! Kitten will walk across the classroom, and the moment they reach the end of the script, the programme will automatically switch to Page 2 (the library), allowing the story to continue. [03:09]
Using these ScratchJr blocks opens up a world of narrative possibilities for your children.
If you enjoyed this, be sure to check out our other coding tutorials for more great ideas. For structured activities, explore our curated lessons designed to build confidence in young coders. Happy coding!