Skip to content

A C++ implementation of the famous game Snake, learning purpose only

Notifications You must be signed in to change notification settings

framilano/SnakePlusPlus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SnakePlusPlus

In-game screenshot

User Input

ESC - exit the game

P - pause the game

R - restart the game (ignoring score and record)

Build Instructions: Ubuntu

  1. Clone this repo
git clone https://github.com/framilano/SnakePlusPlus.git
  1. You need SFML and TGUI libraries, install them with:
sudo add-apt-repository ppa:texus/tgui-0.8
sudo apt-get update
sudo apt-get install libtgui-dev && sudo apt install libsfml-dev 
  1. Compile snakeplusplus opening a terminal inside src/:
g++ -Wall -g scenes.cpp headers/scenes.h snakeplusplus.cpp -lsfml-audio -lsfml-graphics -lsfml-system -lsfml-window -ltgui -o snakeplusplus
  1. You need to place the compiled executable near assets and configs folders to run it, like this Folders placement example

Build Instructions: Windows

  1. Clone this repo
git clone https://github.com/framilano/SnakePlusPlus.git

To build SnakePlusPlus I highly suggest to use Visual Studio 2019

  1. Create a new empty C++ project in Visual Studio, include and link the SFML libraries (using this guide)
  2. As you did with SFML, link TGUI libraries in the exact same way
  3. Inside your project's root folder copy assets, configs and src folders Folders' structure example
  4. Add snakeplusplus.cpp and scenes.cpp to source files in VS, add scenes.h to headers files in VS Solution Explorer
  5. Run in Release x86 mode after compiling the project, the new compiled executable will now appear in \Release
  6. Add next to the executable both assets and configs folders

About

A C++ implementation of the famous game Snake, learning purpose only

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages