In order to get my feet wet in the indie game development scene, I created a few small scale games. For my last two projects, Space Domination and Block Smasher, I used Unity 3D as the game engine. I have dabbled into other library frameworks for C++ like SDL and SFML, but Unity’s built-in editor and scripts system allow me to spend less time on the code and more time on the game play mechanics and visual effects. C# is an object oriented language that is very similar to Java and C++, two programming languages that I have used extensively in the last two years. The way Unity integrates variables from the code into the Unity software allows programmers to debug and test their code within seconds.
The purpose of this game is to introduce enemy controlling scripts. This game uses scripts that instantiate a game object, usually an enemy spaceship, which can then move to various points on the screen. The enemies appear off screen and flow throw giving the player a chance to destroy or avoid them. This is a simple concept that will come in handy in larger scaled games. I can use this same script to move villagers in a set path or animate a small scene similar to RPG games like Final Fantasy on the SNES.
Another concept that I explore in Space Domination is the co-routine method. This method allows routines to execute independent of the update loop. I can make the code wait a period of time before executing. This works nicely for when the player dies or during screen transitions. Without a co-routine, an enemy would get destroyed along with all the scripts that tell it to animate or play sound. Also, when the last phase of enemies is completed, you can use the co-routine method to have the load screen wait before switching to a new scene.
There are a few known glitches or bugs that will need to be worked out if i choose to update the game.
- The mouse and space bar can be used to shoot. If you press both, the player will auto shoot until the end of the stages.
- This is due to the code creating two instances of the Fire() method which only looks for ButtonUp() once to turn off. Since this does not break the game, I programmed the script to just deactivate the shooting after each stage. This can be fixed a few different ways. I can change the method to accept only one input at a time, or I can just restrict the Fire button to only mouse or space bar.
- You can actually get one more weapon upgrade despite the indicator showing 4 full bars.
- This is because I needed an update to the status bar asset file. If I continue with this game, it will have more upgrades and the display will reflect that.
- Not a bug, but should have been implemented, is the ability to shoot the mini flying saucers that the Recruiters’ [Spinning Flying Saucers] fire out. This is by far one of the most challenging aspects of the game. Once those enemies start spawning, the player is in a world of trouble. It’s not too difficult, but I believe the player should be able to blast them down.
- This can be done by changing the mini saucers from projectiles to enemies.
Next Version Ideas
If I decide to create a newer version of this game, I would…
- Change player health to show a bar instead of numbers.
- Allow special item drops from killed enemies to add incentive to kill and not avoid.
- Spend points at the end of each level for upgrades instead of grabbing them.
- Add specialty weapons like missiles as a secondary weapon.
- Add shields to help defend.
- Add lives.
- Create more complex boss battles and enemy variations.
- Have some enemy paths stay on screen until they are killed instead of disappearing off screen.
- Adjust sound effects and tweak placements.
- Add a visual or audio cue when being hit with an enemy weapon or ship.
- More stages.
- More music!
In addition, I’m not very happy with the aspect ratio. Perhaps Space Domination 2 could be horizontal side scrolling instead of vertical.
It was fun to make, and maybe I will get back to it again!