This game is written with an object-oriented approach. The spaceship, bullets, asteroids, and explosions are all classes. Creating the Spaceship The spaceship requires some variables: the initial x location, the
This game is written with an object-oriented approach. The spaceship, bullets, asteroids, and explosions are all classes. Creating the Spaceship The spaceship requires some variables: the initial x location, the
The Explosions Class Each explosion should have its own x and y location, future locations, moving directions, and a set of random speeds. A loop (of 12 iterations) adds the
The Bullets Class First, we need to create bullet class. There should be some variables that apply to all the bullets, such as its speed and how range. The starting
Creating the Asteroids The asteroids in this game are 12-sided polygons (dodecagons). The asteroid class should have five parameters (its size, x location, y location, speed, and tilt). The latter
Generate random points and draw the convex hull of the points. You can use Gift Wrapping algorithm. The animation demonstrates the Gift Wrapping algorithm.