Skip to content

SahandMas/Snake-game-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

Snake Game

Project Overview

This is a classic Snake game implemented in C++ using the clui library for color and input handling. The game features two players controlling their snakes on a grid, with the goal of growing their snakes by eating apples while avoiding collisions with walls, bombs, and each other.

Features

  • Two-player Mode: Players control two snakes simultaneously.
  • Apple Eating: Snakes grow in length when they eat apples.
  • Bombs: Bombs appear on the grid, and snakes must avoid them.
  • Customizable Game Speed: Players can choose from fast, medium, or slow game speeds.
  • Score Tracking: Scores are tracked for both players and displayed at the end of the game.
  • User Management: Users can add new usernames and update existing ones.

Installation and Setup

  1. Clone the repository:
    git clone https://github.com/yourusername/snake-game.git

Navigate to the project directory:

cd snake-game
  1. Compile the code:
    g++ -o snake_game main.cpp

3.Run the game:

./snake_game

Controls Player 1 (Snake 1):

W - Move Up.
A - Move Left.
S - Move Down.
D - Move Right.

Player 2 (Snake 2):

Arrow Up - Move Up.
Arrow Left - Move Left.
Arrow Down - Move Down.
Arrow Right - Move Right.

Game Menu

START GAME: Begin a new game.

POINTS TABLE: View the current scores and rankings.

ADD USERS: Add or change usernames for players.

EXIT: Exit the game. Contributing We welcome contributions! To contribute:

Fork the repository.
Create a new branch for your feature or bug fix.
Make your changes and commit them.
Submit a pull request.
License
This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published