A simple console-based Snake Game built in C++ using basic game programming concepts.
The player controls the snake, collects food to increase the score, and avoids hitting the snake's own body.
- W A S D keyboard controls
- Random food generation
- Score tracking
- Snake grows after eating food
- Collision detection
- Game over condition
- Boundary wrap-around
- Simple console interface
- C++
- Standard Library
- Windows Console Input
This project uses Windows-specific console functions such as conio.h and windows.h.
Compile snake.cpp with a C++ compiler on Windows and run the generated executable.
Example:
g++ snake.cpp -o snake.exe
snake.exe| Key | Action |
|---|---|
| W | Move Up |
| A | Move Left |
| S | Move Down |
| D | Move Right |
| X | Quit Game |
- Variables and data types
- Functions
- Loops and conditions
- Vectors
- Keyboard input
- Random number generation
- Collision detection
- Basic game logic
This is a beginner-level C++ project created for learning programming and game logic. It uses a console interface rather than a graphical game engine.
Author: Anshul Rajput