| .github/workflows | Loading last commit info... | |
| assets | ||
| examples | ||
| src | ||
| .gitignore | ||
| Doxyfile | ||
| LICENSE | ||
| Makefile | ||
| README.md |
Tower Defense
Installation
- Simply git clone and run
makeand then./tdin this directory
Description
Introduction
This is a simple tower defense game written in C++. Tower Defense is a game where you have to defend your base from enemies by building towers to defeat them before they reach your base.
Enemies
Enemies are spawned in waves. Each wave is stronger than the previous one.
There are 4 types of enemies: Minion, Orc, Dragon and Boss and on map are shown
as M, O, D and B respectively.
Minionis basic enemy with no special abilities.Orchas armor, so it takes less damage from towers.Dragonis invisible for specified amount of time after first hit.Bosshas healing ability and heals itself all the time.
Towers
There are 4 types of towers: Tower, Fire Tower, Ice Tower and Sniper Tower and on map are shown
as T, F, I and S respectively.
Toweris basic tower with no special abilities.Fire Towersets enemies on fire, so they take damage over time.Ice Towerstuns enemies.Sniper Towerhas long range and deals high damage but reloads slowly.
Tower can be upgraded to these types, aka specialized.
UI
User interface is realized without any graphics library.
Key bindings
n- next frame (next point in time)t- tower menu (select, build, upgrade, sell)v- start waves- save gamee- exit game
Tower menu
1-9to input tower spotbackspaceto erase numberenterto confirm
When tower menu is active, UI is interactively updated with colors to show which spot is free, which is occupied and whenever are you selecting free or occupied spot as shown in screenshots below.
Other Features
- Save/Load - game can be saved and loaded at any time
- Settings - game settings can be changed in
config.txtfile inassetsfolder - Map Creation - new maps can be created in
assetsfolder and loaded in game usingconfig.txtfile - Input - input is processed without having to press enter
Map Creation
As mentioned above, new maps can be created in assets folder and loaded in game using config.txt file.
Map has to be .txt file and has to contain only these characters:
(space)- empty space-- horizontal wall|- vertical wall1- top left corner2- top right corner3- bottom right corner4- bottom left corner5- double lower corner6- double left corner7- double upper corner8- double right corner+- cross wall!- spawn point?- base point9- tower spot
Using these characters, you can create any map you want. Here is example of map from screenshots:
Other Visual Features
You can see name with health of spawned enemies in lower left corner
Enemy coloring
Default- redAttacked- red backgroundInvisible- blue