HaxePunk shooting game: Source code
Over the past 11 days I've been writing a tutorial series on creating a shooter game using Haxe, OpenFL and HaxePunk framework.
This is the final post, which contains links to the full source code and assets, as well as links to separate tutorial parts.
After following all the tutorial parts you will end up with a fully functional shooter game.
This aim of this tutorial series was to acquaint you with the basics of almost every aspect of the HaxePunk framework.
Let's take a look at the list of features that our game now has:
- Player's ship can be moved using the arrow keys.
- Shoot by holding the space bar.
- Destroy enemy ships for score.
- Colliding an enemy ship results in a life loss.
- The game is lost when there are no lives left, and can be restarted using the enter key.
- The game can be paused at any time using the P key.
- The game stores player's highscore locally, so it is saved even if you close and re-open the game.
- Power ups can be collected for additional lives.
- The game has stereo audio effects.
All of the source code and assets can now be found at the GitHub repository.
If you want to follow the step-by-step guide on creating this game from scratch, check out the links below.
You'll firstly need to install HaxePunk. The whole process is described in this tutorial.
The tutorial series consists of 11 parts. Here they are:
- Project base, texture packing using Atlas, movement, debugging
- Destroyable enemies
- Enemy health and particles using Emitter
- Score display
- Stereo sound effects using Sfx
- Pause the game
- Player's life counter
- Losing and restarting the game
- Saving Highscore locally using Data