Skip to content

Percival33/sokoban

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sokoban game 🎮

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Acknowledgments

About The Project

This was a college project, to implement own version of classic sokoban game. To achive GUI utility, SDL library was used with given template.

Goal of game

push all crates to designated places in the least amount of moves.

(back to top)

Built With

This project was built with

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • SDL
  • CMake

Installation

  1. Download and compile SDL.
  2. Download and setup cmake
  3. Clone the repo & change directory
    git clone https://github.com/Percival33/sokoban.git
    cd sokoban
  4. Move SDL folder to sokoban directory & rename it to SDL2
  5. Create build directory
    mkdir build
    cd build
  6. Run cmake to compile project
    cmake ../.
    cmake --build .
  7. Start game
    ./sokoban

(back to top)

Usage

How to play?

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";

Keyboard shortcuts:

  • ESC to end game
  • n to restart game
  • arrow keys to move around

(back to top)

Level customization

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 rows
  • m - number of columns
  • BOARD: 'x' - crate destination position 'c' - crate position '#' - wall
  • x - x postion of player, number 1 <= x <= m
  • y - y position of player, number 1 <= y <= n

(back to top)

Game screenshots

starting-position-screenshot! last-postion-screenshot! final-screenshot!

(back to top)

Roadmap

  • 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).

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Acknowledgments

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!

(back to top)

About

College assignment to create Sokoban game using SDL

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors