In this part , we update our ship’s initialization to return to a static point after motion as well as add our planet which appears at a random position when the game starts.
First, return our spaceship to it’s starting position:

Next, Add the planet sprite:

And now we set up the initialization to choose a random starting position:
(ENSURE THAT WE ADD THE CODE BLOCK TO THE PLANET’S SPRITE!!!)

In the next part, we’ll update the score on a collision , and reset the score to 0 when a miss occurs.
Next: A Simple Game! – Part 5
© 2019 Vedesh Kungebeharry. All rights reserved.
[…] Next: A simple Game! – Part 4 […]
LikeLike