Programming velocity and speed in Scratch

Lead Image © kudryashka, 123RF.com

Space Maze

We show you how to program speed and direction by guiding a rocket through a maze of alien UFOs.

What's the difference between velocity and speed? That's the question at the heart of this project. Velocity gives speed and direction. For example, "I traveled west on the Interstate at 73mph" is an example of velocity.

In the Space Maze game in this article, a rocket will have the ability to fly up, down, right, and left at varying speeds. The player must navigate the rocket through a field of UFOs to land on a big head in space. The maze, however, is randomly generated, requiring the player to pick a path carefully from the home base to the head.

Every time the rocket collides with a UFO, the rocket has to start the journey over. The object is to reach the head as quickly as possible, without being attacked by a UFO.

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF

Pages: 4

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content