Skip to content

Blackweather/Sokoban

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sokoban

Sokoban SDL2 implementation

Written using C++

Goal of the game

Move the boxes to their positions. You cannot push more than one box at a time.

Controls

arrow keys - movement ESC - exit game N - start new game on current level (moves player and boxes to starting positions) P - next level

How to make maps

It's really easy to make your own maps in this implementation. It's done using .txt files. There are already 14 maps in the map folder.

To make a map

create a new mapXX.txt file in maps folder

XX should be replaced with next map number change the constant MAP_COUNT in Game.h file to match new number of maps

How to fill the map text file?

First line is a single number corresponding to height of map (max 14, because of window size) Second line is a single number corresponding to width of map

Next we have lines filled with characters corresponding to specific pieces of map The number of lines should be equal to the height of map. Number of characters in a line should be equal to the width of map.

Available characters:

G - grass (empty tile outside of walls)

E - empty (empty tile inside walls)

W - wall (tile you can't walk through)

F - finish (final place for box)

B - box (starting place for box)

P - player (starting place for player character)

About

Sokoban SDL2 implementation (C++)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published