Skip to content

SL-Pirate/snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Multi-Player Snake game in sdl

ScreenShots

menu game multiplayer paused game over

build dependancies

  • wxWidgets
  • SDL2
  • SDL2_image
  • SDL2_ttf
  • SDL2_mixer
  • cmake
  • git

Building in linux

git clone github.com/SL-Pirate/snake
cd snake
mkdir build
cd build
cmake ..
make

To Run the program

do sudo chmod +x ./snake

  • This needs to be done only once!
  • after this is done just execute the snake binary from a command line or a graphical file manager.

Building for windows

Setting up building environment for windows

  1. Download and install wxWidgets from their official website

  2. Add the path_to_the_root_of_your_wxWidgets_folder to your system environment variables under the name wxWidgets

  3. Download the development packages of

    • SDL2
    • SDL2_image
    • SDL2_ttf
    • SDL2_mixer

    corresponding to your compiler

  4. Extract the development package of SDL2 and rename the directory as SDL2

  5. Extract the development package of SDL2_image to the same folder and rename it as SDL2_image

  6. Extract the development package of SDL2_image to the same folder and rename it as SDL2_ttf

  7. Extract the development package of SDL2_mixer to the same folder and rename it as SDL2_mixer

    Now your directory should look like this

    {BaseFolder}
    ├── SDL2
        ├── cmake
        ├── include
        ├── lib
        etc...
    .......
        SDL2_image
        ├── cmake
        ├── include
        ├── lib
        etc...
    ........
        SDL2_ttf
        ├── cmake
        ├── include
        ├── lib
        etc...
    ........
        SDL2_mixer
        ├── cmake
        ├── include
        ├── lib
        etc...
    
  8. Add the path_to_the_root_of_your_SDL2_BaseFolder to your system environment variables under the name SDL2

Compiling

  • if using MinGW32-gcc
git clone github.com/SL-Pirate/snake
cd snake
mkdir build
cd build
cmake .. -G "MinGW Makefiles"
make
  • if using msvc
git clone github.com/SL-Pirate/snake
cd snake
mkdir build
cd build
cmake --build ..