Table of Contents
This was a college project, to implement own version of classic sokoban game. To achive GUI utility, SDL library was used with given template.
push all crates to designated places in the least amount of moves.
This project was built with
To get a local copy up and running follow these simple example steps.
This is an example of how to list things you need to use the software and how to install them.
- SDL
- CMake
- Download and compile SDL.
- Download and setup cmake
- Clone the repo & change directory
git clone https://github.com/Percival33/sokoban.git cd sokoban - Move SDL folder to sokoban directory & rename it to
SDL2 - Create
builddirectorymkdir build cd build - Run cmake to compile project
cmake ../. cmake --build . - Start game
./sokoban
To start game, run the program. Then use arrow keys to move around board. To push crate you need to move player onto crate's position.
After moving all crates to final positions, final screen is showing up and game freezes for 3 seconds.
To play on different level replace name of your level on line 21 of src/game.cpp. See this link
const char LEVEL_NAME[] = "level2";ESCto end gamento restart gamearrow keysto move around
To create your own level, create your_level_name.txt file. See level1.txt as reference.
Structure of file:
n m
BOARD
x y
where:
n- number of rowsm- number of columnsBOARD: 'x' - crate destination position 'c' - crate position '#' - wallx- x postion of player, number 1 <= x <= my- y position of player, number 1 <= y <= n
- Add images
- About project section
- Add level customization
- Finish installation section
- Update Usage section
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt for more information.
Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!



