Your Objective:

Create a script that moves a sprite around the screen

The Challenge

This week, we are going to using the Motion blocks combined with the wait blocks to have our Sprite move around the screen.

We want our Sprite to move in the shape of a square e.g. Move 50 steps, and rotate 90 degrees and repeat that process until the Sprite is back at its starting location.

 

Don’t forget to add wait blocks in-between the Motion blocks so that you can see the Sprite moving.

 

 

Recommended Time:
10-15 minutes

Tip Sheet:
Now Available

Live Demo:
25/09/2021
Saturdays, 12:00pm to 1:00pm

Join Session

 

 

Add a ‘When Start Clicked’ event to your Sprite’s script so that the script will run when the program starts.

 

Then add a Move 50 Steps blocks underneath the event block, followed by a wait block of 0.5 seconds.

 

When you click on the 'Green Flag', the sprite should move in a square pattern!

 

Forgotten how to add blocks to your script?

  • Click on the Sprite whose script you want to edit, and then click and drag the appropriate code block into the scripts panel.

 

Forgotten how to run the code blocks you’ve added to your script?

  • You can either double click on the code blocks to run them, or if you’ve add a ‘When Start Clicked’ event you can click on the Green Flag at the top of your project window to run your script.

 

Forgotten how to change the values in a script block?

  • Click once on the value you want to change and the block will give you the option to edit it.