Kessler Syndrome is an Asteroids clone and the first game I’ve finished for this project. Actually, my first few iterations were Zork, Pong, and Space Invaders:
- Zork I played but decided not to recreate because none of the code would be applicable to any other game I was going to make (plus text adventures are just painful to play).
- Pong I mostly completed, but since it was exclusively multiplayer and the code I wrote was horribly ugly I decided to just move on to the next game.
- Space Invaders I actually was very close to completing but realized near the end that I really needed to be using a different ECS framework than the one I’d started with. Since I’m planning on covering other single screen shooters for this project I decided to just move on. The next game I’m planning on covering is Galaxian which is essentially a better Space Invaders so no one will really be missing much.
Normally I’d start out by doing some gameplay analysis and coming up with a list of features I’m expecting to add. In this case since I didn’t have this blog created until the game was done I’m mostly going to skip that part.
Asteroids Gameplay Link to heading
Asteroids is a fairly simple game:
- You control a spacecraft which moves with simple physics in an asteroid field.
- You can shoot the asteroids, which causes them to split into smaller asteriods.
- Large asteroids split into medium asteroids, which in turn split into small aseroids.
- When you shoot a small asteroid it is destroyed without splitting.
- When you have destroyed all the asteroids on the screen you move on to the next level.
- Each asteroid is worth a certain amount of points, the goal is to get a high score.
Noteworthy Engine Features and Assets Link to heading
As this is the first game I’ve done, the entire engine is new. I might go into more detail for things added to future games but I’m just going to give highlights for this one:
- I’ve created my own version two classic video game fonts. Mostly this was done by copying from the book Arcade Game Typography by Toshi Omagari and editing them to match my own style.
- One font is based on the classic Atari font used in my different games (you’ll recognize it when you see it).
- The other is based on the font used by Space Harrier. I added this because Asteroids is a black and white game. As a result anything moving behind the letters makes them hard to read. The space harrier font is an outline font so it is readable against a black or white background. It’s also a bit fancier looking so works well for titles etc.
- I’ve created sprites for:
- three sizes of asteroid
- a small projectile
- a small explosion
- I’ve built the game around a simple state machine where each state represents a different “screen” in the game. I’m calling these “scenes” which I am pretty sure is the correct game dev terminology for it, but I’m pretty much just naming things intuitively as I go rather than trying to stick to some standard. The scenes implemented include:
- A title screen scene
- A scene which has all the gameplay
- A scene where the player can enter there initials after the game ends
- A score board scene
- The game uses an Entity Component System package called Donburi which is designed to work with Ebitengine.
- I have sound working, and am using some free sound effects from various sources. They’re not amazing but I’m not ready to go too deep down the audio rabbit hole just yet.
- I’ve also implemented global highscores.
Differences from Asteroids Link to heading
- The original Asteroids is entirely done in vector graphics, however most games from this era are done with sprites. Since I wanted to to re-use as much code as I can in future games I decided to go with sprites for most of this game.
- Because of this I had to approach text much differently than was done in the original game. I ended up using some common arcade fonts from the era as described above.
- The exception to this is the player’s spacecraft, which is done with vector graphics. The spacecraft must be able to rotate 360 degrees, and doing that with sprites causes a lot of issues. Drawing individual frames for the rotation would have been time consuming and probably looked bad. Additionally, the spacecraft would only able to point at the exact angles you’ve drawn frames for, which can feel unnatural. Due to rendering the game at the natural resolution of my sprites, the spacecraft ends up looking pixelated and blending in fairly well with the sprite graphics. Interestingly it looks much better while in motion than it does when stationary.
- My point values are not the same as the original. I’m not a fan of that thing where the point values all have a few extra 0’s added onto the end just to look “big”.
- The way each wave’s difficulty scales is not the same as the original.
- In Asteroids you gain another life every time you score a certain number of points. I did not include this mechanic. (Not because it’s hard to implement, I just don’t like it added much value.)
- In the original a UFO enemy shows up periodically, but I didn’t implement this. I’m just not sure I think it adds much to the core gameplay.