π Snake Game (C++ Console)
A console-based Snake Game developed in C++ with colorful terminal output, sound effects, and multiple difficulty levels. The game runs on Windows and provides an interactive console experience.
β¨ Features
π’ Multiple difficulty levels: Easy, Medium, Hard, Very Hard
π¨ Colored console interface using ANSI escape codes
π Sound effects for eating fruits and losing (Windows PlaySound)
π’ Dynamic snake tail movement
πΉοΈ Real-time input using keyboard (w, a, s, d)
π Score tracking and automatic game over detection
π Option to play again without restarting the program
πΉοΈ Gameplay
The game starts with a main menu to choose the difficulty level.
Snake starts at the center of the map.
Player moves the snake using keys:
w β Up
s β Down
a β Left
d β Right
Eat fruits ($) to increase score and grow the tail.
Hitting walls or the snake tail ends the game.
After losing, you can choose to play again.
π― Controls
w, a, s, d β Move the snake
x β Exit the game
Y / N β Play again or exit
π οΈ Technologies Used
Language: C++ Platform: Windows
Libraries & Headers:
β Input/output
β Random number generation
<conio.h> β Real-time key input
<windows.h> β Console manipulation & Sleep
<mmsystem.h> β Play sound effects
Concepts:
Arrays & structures
Functions
Loops & conditions
Enums
Random number generation
Console cursor manipulation
Make sure you are using Windows.
Compile the code using a C++ compiler (e.g., MinGW or Visual Studio).
Run the executable from the console.
Example (MinGW):
g++ snake_game.cpp -o snake_game snake_game
πΈ Screenshots
π Notes
This project is designed for learning C++ fundamentals and practicing console application development.
Sound effects work only on Windows OS.
Difficulty levels control the speed of the snake (Lower value = faster movement).
π€ Author
Wael Samer Software Engineering Student
GitHub: github.com/waelodeh98
LinkedIn: linkedin.com/in/wael-samer

