A simple Game! – Part 3

In this part, we move our spaceship until it touches the edge.

We will move our spaceship 3 units at a time in the direction it’s facing until it touches the edge of the screen.

First setup the constraints for moving until the edge is touched. We accomplish this using a looping construct and a sensing block:

Now we add the following code block to move the ship:

It’s setup is shown here:

It is important to note that you don’t need to understand how the codeblock above works, only that it moves the ship 3 units in the direction it’s pointing!

Our final scenario is shown below:

Next: A simple Game! – Part 4

© 2019  Vedesh Kungebeharry. All rights reserved.  

One thought on “A simple Game! – Part 3

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s