Terminal fighting game written in C++ using ncurses library for graphics. Characters are modeled and animated using developed ASCII art. The project is a simple combat game. For graphics I used ncurses library and developed ASCII art characters. The game implements simple UI. For the purpose of loading assets I developed simple markup language.
Project can be built using a built.sh
script which is a simple wrapper
for Bazel CLI.
Release
./build.sh linux release
Debug
./build.sh linux debug
Release
./build.sh macOS release
Debug
./build.sh macOS debug
To start the game simply run:
./bazel-bin/ascii-combat
You will be welcomed with this simple menu.
NOTE: Only Local Multiplayer mode is currently implemented.
In local multiplayer mode players play using the same keyboard. Player1 (on the left) is using WSAD keys. Player2 controls the character with arrows.
Controls:
- up: jump;
- down: attack;
- left: go left;
- right: go right;
At any time you can pause/exit the game by pressing q
.
To lint the project run:
./lint.sh
Configured linters:
- cppcheck
- cpplint
- clang-tidy
To automatically apply code fixes run:
./fix.sh
This will format the code, apply fixes from clang-tidy and automatically add missing copyright clauses.
For the purpose of loading assets simple markup language was implemented.
First it looks for name tag (f.e. Map, Player). Then if it's Map, algorithms is as follows:
- read lines of map until EOM markup
- save map For Player: (read animations)
- read number (it's number of animation frames)
- read lines of animation's frame until EFM (end of frame) markup
- jump to first instruction and repeat until EOC markup(end of clip)
- jump to first instruction and repeat until EOA (end of animation)
- read animations until END markup
Parsing finishes when EOF is found
- Use Bazel's
select
to differentiate between platform.
- Create a CI.
- Add GTest.
- Modernize the code.
- Test and refactor assets module.
- Add more weapons.
- Allow the game to run at 60fps (floating point arithmetic).
- Implement networking based on Protobufs.
- Implement a simple AI bot.
- Package the app.
- Add simple audio effects.