Skip to content

Recreated my SnakeGame in C++ with SFML Graphics library

License

Notifications You must be signed in to change notification settings

Dheovani/SnakeGame

Repository files navigation

SnakeGame

Gameplay.mp4

This is a classic Snake game implemented in C++. It's a simple yet entertaining game where the player controls a snake that grows longer as it consumes food.

How to Play

  1. Clone or download the repository.
  2. Compile the code using a C++ compiler, e.g., gcc main.cpp -o snake_game.
  3. Run the game with ./snake_game (on Unix-based systems) or snake_game.exe (on Windows).

Controls

  • Use the arrow keys to control the direction of the snake:
    • Up:
    • Down:
    • Left:
    • Right:
    • Enter: 🔄

Gameplay

  • The snake starts with a length of one.
  • Move the snake to collect food (green circles).
  • The snake grows in size when it eats food.
  • Try to achieve the highest score by eating as much food as possible without colliding with yourself.

License

This Snake Game in C++ is open-source and available under the MIT License. You are free to use and modify the code for your purposes.

Happy gaming! 🐍