Giter VIP home page Giter VIP logo

sdl2-sokoban's Introduction

sdl2-sokoban Build Status

Cross-platform Sokoban clone written in C++ and SDL2. Maps authored using Tiled map editor and loaded using TMX C Loader.


Dependencies

This project depends on SDL2, SDL_image 2.0, SDL_ttf 2.0 and TMX C Loader, which depends on zlib and LibXML2.

Installing dependencies on Windows

It is assumed that tar and curl are available.

Clone the repository and install dependencies by running the provided batch scripts from a Visual Studio Native Tools Command Prompt

git clone https://github.com/howprice/sdl2-sokoban
scripts\install_sdl.bat
scripts\install_tmx.bat

Alternatively the SDL2, SDL_image 2.0 and SDL_ttf 2.0 Windows VC development libraries can be unzipped manually into the 3rdParty folder, removing the version numbers from the directory names.

To install TMX manually see TMX.md.

To use different lib versions edit the variables at the top of install_sdl.bat and install_tmx.bat.

Installing dependencies on Linux

Install developer libs using a package manager. For example, for Ubuntu and Raspberry Pi:

sudo apt-get install libsdl2-dev
sudo apt-get install libsdl2-image-dev
sudo apt-get install libsdl2-ttf-dev
sudo apt install libxml2-dev
sudo apt install cmake

Clone, build and install TMX C Loader

git clone https://github.com/baylej/tmx
cd tmx
mkdir build
cd build
cmake ..
make
sudo make install   

Installing dependencies on Mac OS X

brew install sdl2
brew install sdl2_image
brew install sdl2_ttf
brew install cmake
git clone https://github.com/baylej/tmx
cd tmx
mkdir build
cd build
cmake ..
make
sudo make install  

Building and Running

This project uses GENie to generate the build files for the target platform. The GENie executables for Windows, Linux, Mac OS X and Raspberry Pi can be found in the tools directory for convenience.

There are three build configurations:

  • Debug - no optimisations, symbols, asserts
  • Dev - optimisations, symbols, asserts
  • Release - optimisations, no symbols, no asserts

Windows

Run genie_vs2017.bat or genie_vs2019.bat to generate the Visual Studio Solution and Project files into the 'build' folder. Build and run from within Visual Studio, or build from the command line with MSBuild.

Linux (including Raspberry Pi)

Clone this repo, build the makefiles and build:

$ git clone https://github.com/howprice/sdl2-sokoban
$ cd sdl2-sokoban
$ scripts/genie_gmake.sh
$ cd build
$ make

n.b. You may need to 'chmod +x' genie executable and or .sh shell script files.

make with no config specified defaults to the debug config for native architecture (usually 64-bit). Can call make config=<xxx> where xxx can be debug, dev, release, debug32, dev32, release32, debug64, dev64 or release64. Or type make help for more info. Make sure you're in the build folder.

To run the game

$ cd data
$ ../bin/x86/debug/sdl2-sokoban   (or x64, or dev or release)

Mac OS X

Clone this repo, build the makefiles for either gcc (aliased to clang on Mac) or Xcode:

$ scripts/genie_gmake.sh   // then build and run as Linux above

or

$ scripts/genie_xcode10.sh   // then build and run in XCode

Cleaning the build files

Run genie_clean.bat on Windows or genie_clean.sh on other platforms.

Controls

Cursor keys

Links and thanks

TODO

License

See the LICENSE file for details.

sdl2-sokoban's People

Contributors

howprice avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

stahta01

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.