Skip to content

Latest commit

 

History

History
53 lines (31 loc) · 2.4 KB

Readme.md

File metadata and controls

53 lines (31 loc) · 2.4 KB

Snake Game in C++

Welcome to the Snake Game! This C++ console-based game allows you to control a snake and collect fruits to score points. The game features multiple modes, including an Easy mode with no death on touching the walls and a Medium mode where touching the walls results in game over. You can also view the Hall of Fame to see the high scores of previous players. The game includes a save feature to store your score for future reference.

How to Play

  1. Clone or download this repository to your local machine.

  2. Compile and run the C++ code using your preferred C++ compiler.

  3. Follow the on-screen instructions to choose your game mode and control the snake:

    • Use the 'W' key to move the snake upwards.
    • Use the 'S' key to move the snake downwards.
    • Use the 'A' key to move the snake to the left.
    • Use the 'D' key to move the snake to the right.
    • Press 'X' to exit the game.
  4. The goal of the game is to collect as many fruits as possible to score points. Be careful not to collide with the walls or the snake's tail, as it will lead to game over.

Game Modes

  1. Easy Mode: In this mode, the snake will not die on touching the walls. You can enjoy collecting fruits without the fear of game over due to wall collisions.

  2. Medium Mode: In this mode, the snake will die on touching the walls. Be cautious and navigate carefully to avoid hitting the walls and survive as long as possible.

Hall of Fame

You can access the Hall of Fame to view the high scores of previous players. The game will display the names of players along with their scores in the Easy and Medium modes.

Save Feature

The game includes a save feature that stores your score for future reference. If you achieve a high score, your name and score will be recorded in the Hall of Fame.

Music

Enjoy the game with background music to enhance the gaming experience. The game plays background music using the "snakes1.wav" file.

Controls

  • 'W': Move the snake upwards.
  • 'S': Move the snake downwards.
  • 'A': Move the snake to the left.
  • 'D': Move the snake to the right.
  • 'X': Exit the game.

Credits

This Snake Game was created by https://github.com/jasmeet1234. It was developed using C++ and various standard libraries.


Have a great time playing the Snake Game! If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request. Happy gaming!