A learning project whose goal is to write an application analog of the game Spy Hunter. You can read about the original version here. SDL graphics library is used for interface rendering.
The goal of the game is to survive as long as possible and gain points. The player has 3 lives at the beginning of the game, which are not consumed during the first 60 seconds. Additional points are awarded for killing enemies. You can kill cars in 2 ways (push them off the road, shoot them with a gun). There are 2 types of enemies:
- Passive (do not interfere with the player)
- Active (try to push the player out of the way)
Also on the track there are cars-allies, for killing which the player's points is frozen for some time.
A hint for the control buttons is shown in the lower right corner. Also during the game appear additional hints with keys that work only in that place.
The basic control buttons can be found below
Key | Action |
---|---|
Space | Fire a shot |
P | Pause/Resume game |
F | Finish the game |
N | Start new game |
S | Save current state to file |
L | Load current state from file |
Arrows | Move around the road |
The application is written for the Window platform and requires Visual Studio to run. To start it you need to open the project file szablon2vs19.sln
with Visual Studio and start the project build.
The SDL library and bmp graphics are used to render the interface. The application allows you to save the game state to a file and then restore it. For this purpose the application reads save files from directories and shows their names for selection.
The application stores a road pattern in the road.txt
file and repeats this pattern cyclically.
It also prompts the player to save his result after completing the game. If the user accepts, his current result is saved in the file. And the pause menu shows the best results for the whole time sorted by time or points (by default).