/snake-game

This is a simple implementation of the classic Snake game using SFML (Simple and Fast Multimedia Library) in C++. In this game, the player controls a snake that moves around the screen, eating food to grow longer. The objective is to eat as much food as possible without colliding with the snake's own body.

Primary LanguageC++

C++ Snake Game

This is a simple implementation of the classic Snake game using SFML (Simple and Fast Multimedia Library) in C++. In this game, the player controls a snake that moves around the screen, eating food to grow longer. The objective is to eat as much food as possible without colliding with the snake's own body.

Dependencies

  • SFML

How to Use

Prerequisites

Make sure you have the following dependencies installed on your system:

  • SFML
  • GNU Make

Installation

  1. Clone this repository.
  2. Navigate to the root directory of the project.
  3. Run make in the terminal to compile the source code.
  4. Once compilation is complete, execute the game by running ./snake_game.

Usage

  1. Use the arrow keys to control the direction of the snake:
    • Up arrow: Move the snake upwards
    • Down arrow: Move the snake downwards
    • Left arrow: Move the snake to the left
    • Right arrow: Move the snake to the right
  2. Eat the food (displayed as icons) to grow the snake and increase your score.
  3. Avoid colliding with the snake's own body or the walls of the game area.
  4. The game ends when the snake collides with itself.

Enjoy playing Snake and have fun!