Skip to content

epiitom/Snakegame_c-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Snakegame_c-

Welcome to the classic Snake game! This project is a simple console-based implementation of the Snake game using C++.

About

This project is a basic implementation of the Snake game. The objective of the game is to navigate the snake to eat the fruit, which makes the snake grow longer. The game ends if the snake runs into the wall or its own tail. The player's score increases with each fruit eaten.

Features

  • Snake moves within a defined boundary.
  • Snake grows longer with each fruit eaten.
  • Score tracking.
  • Adjustable difficulty levels.
  • Pause and resume functionality.
  • Displays the highest score for the current session.

Requirements

  • A C++ compiler (e.g., GCC, MSVC)
  • Windows operating system (due to the use of <conio.h> and <windows.h> libraries)

Installation

  1. Clone this repository to your local machine:

    git clone https://github.com/yourusername/snake-game.git
    cd snake-game
  2. Compile the source code using a C++ compiler:

    g++ snake_game.cpp -o snake_game
  3. Run the executable:

    ./snake_game

Usage

  1. Run the game executable from your command line or terminal.
  2. Enter your name when prompted.
  3. Choose the game difficulty level.
  4. Use the controls to play the game.

Controls

  • w - Move Up
  • s - Move Down
  • a - Move Left
  • d - Move Right
  • p - Pause/Resume
  • x - Exit the game

Contributing

Contributions are welcome! Please feel free to submit a Pull Request or open an issue if you have any suggestions or find any bugs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages