Skip to content

sp4r1ng/snake_game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game in C++ with SFML

Game Preview

This project is a simple implementation of the classic Snake game using the SFML library for graphics rendering. The game includes obstacles that randomly appear, adding an extra challenge.

Prerequisites

  • Operating System: Ubuntu (or any other system compatible with SFML)
  • SFML Library: Ensure SFML is installed on your system.
  • C++ Compiler: GCC or any other compiler compatible with C++11 or later.

Installation

  1. Install SFML:

    • On Ubuntu, you can install SFML using the following command:
      sudo apt update
      sudo apt install libsfml-dev
  2. Clone the Repository:

    • Clone this repository to your local machine:
      git clone https://github.com/sp4r1ng/snake_game
      cd snake_game

Compilation and Execution

  1. Compile the Project:

    • Use g++ to compile the project with SFML libraries:
      g++ -o snake_game main.cpp -lsfml-graphics -lsfml-window -lsfml-system
  2. Run the Game:

    • Once compiled, run the game with:
      ./snake_game

Controls

  • Movement: Use the arrow keys (up, down, left, right) to control the snake.
  • Objective: Avoid the obstacles that randomly appear on the screen.

About

Snake Game in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages