This tutorial series will step you through the process of creating a space invaders clone with the PushButton. Most of the concepts have been covered in my earlier PushButton Tutorial series, which touched on the basics of the PushButton engine, but did not actually create something “playable”. Here we will build off those lessons to create an actual game.
One aspect that was not dealt with in the previous tutorials was the separation of game logic and content. The game logic is the foundation of the game, and in PushButton is essentially a collection of components that can be combined to create the enemies, bullets, explosions and player entities that you see on the screen. This is the programmer’s domain. The game content on the other hand defines how the levels look and feel. It defines the placement of an enemy in a level, the sprites that will animate the players character, the location of the platforms that the player can jump on etc. This is usually handled by a level designer or artist.
Separating the two allows a team of more than one person to more easily collaborate on a project. Ideally the game content is all created by a nice editor that can export a level definition file, which is loaded and run by the game. In PushButton this separation is made simple by the XML serialisation/deserialisation that is included in the engine. Game content is defined in an XML file, and the game logic is defined in the components written by the programmer.
For this reason the space invaders project will focus on maintaining this level of separation. The game logic will be contained in PushButton components, while the actual layout of a level will be defined in XML files. To get things started a minimal application has been created based off the tutorial series (especially the Level Loading tutorial) that places one animated space invader on the screen. If any of the code in this base application is unfamiliar to you please read the tutorial series as it covers all the basics that you will need to know to make this space invaders game.