Starship is a single player 2D shooting games based on Asteroids. Players control a ship to move around, shoot bullets against enemies and asteroids. One special feature of this Asteroids clone is the ship transforming feature. Use left/right arrow to turn, up arrow to thrust, space to start the game/attack, N to respawn when ship exploded, and left ctrl to transform.
This is my first project build with my own engine. The engine was implemented using C++ and OpenGL. In the last milestone, I decide to add the transforming feature because I think it is really cool.
The game is a very typical and simple one. So I will focus on features that are interesting, ignoring the basic controls.
When any entity is destroyed, including bullets, enemies, the ship, asteroids, they release some debris with random but nearly round shape and color same as the entities that released them. This is a tiny feature that greatly improves the juiciness of the game.
Here is the code of the constructor of Debris and the function that generates the Debris cluster. You can see how the shape and direction are randomized when a Debris is created, so when we initialize them we only need position, speed, color, and size.
There are two different kinds of enemies in the game: Beetles and Wasps. And they act differently against the player ship.
Beetles simply always try to face the player and move towards the play at a constant speed. Wasps, on the other hand, accelerate toward the player.
Even though the wasp is faster, but they can easily miss the player and because they are too fast, it's hard to them to regain control.
Here is the code about how Wasps and Beetles chasing the player.
The ship can transform between two modes if the player presses left ctrl: Ranger mode and Rider mode.
In Ranger mode the gameplay is like a regular Asteroids, you press space to shoot. In Rider mode, however, if you press space, the ship turns blue and charge forward, crashing enemies in the way. The Rider mode deals more damage and able to destroy anything in one attack, but the ship easily gets out of control.
I hardcoded the simple animation for the transformation.
I divide the transforming process into three stages, and I only move certain parts in each stage, making the transforming looks detailed. When the transformation happens, I actually change several floats that affect the positions of different ship parts when I render the ship.
The debris and transforming make the game look juicy.
The architecture is clear and easy to manage.
The animation is hardcoded, cannot be used for other games.
The difficulty is not very reasonable, can be too hard.
Make a 2D animation system that can be used easily.
Do more playtest and adjust the difficulty.
More Enemies.
More abilities.
Maybe some items.