The obstacle course – combining many ScratchJr scripts

This project is all about combining different ScratchJr scripts and running them simultaneously.

We’ll create an animation with a rolling ball. The ball rolls down the slope, but then falls into a hole and stops there. Play the video below to see the ball in action:

Create your obstacle course background

The first step is to create a background for your animation. It should have a slope (inclined at exactly 45 degrees), a stretch of flat space and a hole for the ball to fall into.

You can draw your background in the paint editor. You’ll need to draw several rectangles (use the rectangle shape tool) and move them around to form a desired course. To create the slope, first draw a square, and then use the rotate tool to rotate your square by 45 degrees.

Scratchjr obstacle course background in paint editor.

The other (faster and simpler!) way is to take a photo of the obstacle course picture.

Fill out the form below to download your printable for free. Print your picture and take a photo of it using the camera tool.

Scratchjr obstacle course resource preview.
To download this picture, fill out the form below. Print it and take a photo in the ScratchJr app.

Roll the ball!

The next step is to add a character (pick any ball) and prepare your ScratchJr scripts.
You can start with simply moving the ball from the starting point to the end point (no rotation; we’ll add this later). The ball should first roll down the slope. If your students are not familiar with this technique, check out this blog post to learn how to perform a diagonal movement in ScratchJr.

ScratchJr scripts solution without rotation.
Solution scripts (without rotation)

Next, we can add rotation so that the movement looks more natural.

The trick is to run yet another script at the same time – the ball should rotate and stop only when it reaches the end point. What we need is an orange stop block – this block stops ALL the scripts that a given character is running at the moment (including those running in an infinite loop).

Here is the complete solution:

ScratchJr scripts complete solution with rotation.
Complete solution scripts (with rotation)

Did you like this project? You can find more inspiration to combine different ScratchJr movement scripts in this post.

Happy coding!

One comment

Leave a Reply

Your email address will not be published.