A simple Game! – Part 2

In this section, we start by getting setting up the initial state of our game.

We need a variable to store the bearing, and here we set the bearing to 0 and point the spaceship vertically:

Ensure that your rocketship’s sprite is selected so that the code is applied to the rocketship.

Note the use of the broadcast system – we use this to achieve a modular approach.

Next, we setup the code to Accept the bearing and turn the ship:

Now, when we click on the green flag, we’re able to prompt the user to enter a bearing and turn our rocketship!

The full code is shown below:

Next: A simple Game! – Part 3

© 2019  Vedesh Kungebeharry. All rights reserved.  

One thought on “A simple Game! – Part 2

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