From the beginning of my programming journey, I was so passionate about game development, so a few weeks back, I started to learn SDL2.
So I made a recreation of classic Space Invaders for the final project of Advanced programming.
This implementation has external dependencies on the following libraries:
- SDL2
- SDL2_ttf
- SDL2_image
- For Debian-based systems run command below to install SDL2 and everything necessary to build programs:
sudo apt-get install libsdl2-dev
- For Red Hat-based systems runcommand below to install SDL2 and everything necessary to build programs:
sudo dnf install SDL2-devel
- common.h: including base headers and declare extern variables
- base.h: declaring base classes.
- App: main class of the game
- Entity: use this class to create entities in the game like player.
- Interval:
- defs.h: defined global variables.
- init.h: initialize & prepare the SDL.
- draw.h: declare some functions to simplify drawing part of the game.
- enemies.h: create enemies, bullets and charechteristics of enemies.
- handlingPlayer.h: create player bullets and handeling player movements.
- input.h: handle inputs and assign functionallity to the keys.
- scenes.h: handling special scenes in game such as GAME OVER.
- underLine.h: drawing the green line in the game.
- walls.h: handling walls in game.
main()
: main function contains the main game loop.renderMenu()
: we use it to render menu page and show it bydisplayMenu()
.renderControls()
: we use it to render controls page and show it bydisplayControls()
.renderAbout()
: we use it to render about page and show it bydisplayAbout()
.