Creating a Game in C++ (Part2)
Moving on where we left off (Creating a Game in C++ — Part1), we will design an “Asteroids” clone (ATARI game from 1979) but with a twist 😉.
So, let’s create a simple Game Design Document first...
Game Design Document
Core Concept
Player controls a flying saucer which mines asteroids for their precious core. Our game is called “MINOIDS” (for now 😁).
Main Features
The flying saucer can fire a mining-beam that will gradually mine the asteroids in order to get to their core. While mining, the asteroids may lose some parts of them and gradually shrink, until they reveal their core. Then the player has to retrieve all the core in order to win. The cores cannot be destroyed. If any of the asteroids or their parts, touch the flying saucer, then the player loses 1 life. Player starts the game with 3 lives, and when all lives are lost then game is over.
Genre
Minoids is an Arcade game.
Target Platform / Audience
Minoids is a game for ALL and initially planned to be played on Linux, Windows, Web and going to be published to itch.io. Later on, publishing it to a web-games platform like poki, and also its own web-page would be a preferred option.
Gameplay
In Minoids, the flying saucer can be controlled with either the keyboard or GamePad Arrows. The mining beam can be fired by pressing either the Space (Keyboard) or A (Gamepad) key. There should be a progression system, of gradually difficulty i.e more and bigger asteroids will have to be mined per level. Score points will also be used i.e current score per level and max score for the player.
UI
Minoids will have a Splash, a Menu and a Game screen. In Splash screen, a title, possible logo along with a basic background will be presented. Menu screen will contain a start/continue, settings and exit buttons. Game screen will display the current number of asteroid cores, the current/max score, a pause button and player’s lives.
Technical
Now that we have established the basic game specs, let’s proceed with the actual software architecture. Minoids is a simple game, however the main purpose of those series of blog posts is for me to catch up with C++ and Game Development best practices. Therefore I will try to create a simple Entity Component System (ECS) that will make things easier when I will dynamically be creating asteroids and assigning properties (Components) to game objects (Entities). I greatly value composition over inheritance on many cases, so I will limit OOP as much as possible. All in all, “Minoids” architecture will include the following:
- Scene Manager
- Screen Transitions
- Screen Overlays - Entity Component System
- Core: create/delete entities, assign/unassign components
- Movement / Positioning System
- Collisions System
- Leveling / Scoring System
- Rendering System - Storage Manager: Save / Load
- UI Assets Manager
- Textures
- Fonts - Sound Manager
- Sound Effects
- Sound Settings
Finally
Optimistically, Minoids game is planned to be finished in 2 weeks. In the mean time I might come up with new idea and/or enhancements for it, however, it is best if I produce an MVP first and polish later.
See you, on the next post…
Thanks for reading!
On to the next post (Creating a Game in C++ Part 3) …
