
Follow our easy step-by-step coding instructions to create your own robot in Scratch, using variables, loops and conditions, and try to avoid the UFO!
If you already have a Scratch account, click ‘Sign in’ and enter your login details. Otherwise click ‘Join Scratch’ and create your free Scratch account.

You'll notice this sprite already has some code.
The forever loop makes sure you can continue to move while the game is running


Can the robot move left and right when you press the arrow keys?



The 'stop all' block stops all the code in the game

This code will make a new copy of the crystal every second

We can use the 'pick random' block to make them appear in random positions

Do you see the crystals appearing?




If you enjoyed this coding activity be sure to sign up for our online coding classes for kids. Our coding classes are a lot of fun, but they’re also really effective at teaching coding techniques and challenging students to develop their skills. You’ll learn about loops, variables and functions - and everything in between - and you’ll build your own games and animations with a small group of kids of the same age and experience level as you.
Sign up for one of our free coding lessons