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”
[…] A simple Game! – Part 2 © 2019 Vedesh Kungebeharry. All rights […]