A stage-based terminal snake game implemented in C++ using the
ncurseslibrary.
Includes gates, missions, stage progression, scoring system, and more.
- Arrow-key controlled snake with auto-movement
- Items:
- 🍎 Growth Items: +1 Length
- ☠️ Poison Items: -1 Length
- Gates:
- Teleport between gate pairs
- Cooldown system and gate regeneration
- Stage system:
- 4 unique stages with missions (length, item collection, gate use)
- Game Over conditions:
- Wall/Body collision
- U-turn
- Length < 3
- Using gate during cooldown
- Stage time limit exceeded
- Scoring and ranking system saved to
highscore.txtandranking.txt - Gameplay demo available
snake_game.cpp— Main game source codeMakefile— Compile instructionshighscore.txt— Local high score recordranking.txt— Cumulative ranking datasnake_game_rules.png— Game rule imagesnake_game_demo.mp4— Gameplay demo video
makeThis will compile snake_game.cpp using the provided Makefile.
Ensure that you have ncurses installed:
sudo apt-get install libncurses5-dev libncursesw5-dev./snake_game- Movement: Use arrow keys. U-turns and self-collisions cause Game Over.
- Growth/Poison: Snake must maintain length ≥ 3 to survive.
- Gates: Appear on walls. Entering during cooldown results in Game Over.
- Items: Disappear after 300 ticks. Max 3 Growth and 3 Poison on screen.
- Mission: Complete each stage's length, item, and gate goals.
Scores are automatically saved after each game. Rankings are viewable in ranking.txt.
If highscore.txt or ranking.txt does not exist, they will be created automatically on the first run.
This project is for educational and non-commercial use only.
Feel free to fork and expand upon it!
