Skip to content

Clone of the sokoban game made in javascript

License

Notifications You must be signed in to change notification settings

nfdavi/kaj-sokoban-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sokoban

Clone of the Sokoban game made in modern JavaScript.

The game is intended to be used with a simple backend that provides maps and scoreboards, though it can be used without it as well - you will just have to load the maps from a local file and you won't have any of the scoreboard functionality.

Setup

Just edit the server address in sokoban/js/util.js on line 22 and you're good to go.

Map format

Maps are stored in JSON format. It's easiest to explain the way it works by an example:

{
    "width": 4,
    "height": 4,
    "walls": [4, 8],
    "crates": [10, 11],
    "targets": [14, 15],
    "player": 5
}

Represents the following 4x4 map:

|-------|-------|-------|-------|
|       |       |       |       |
|  (0)  |  (1)  |  (2)  |  (3)  |
|       |       |       |       |
|-------|-------|-------|-------|
|       |       |       |       |
|  (4)  |  (5)  |  (6)  |  (7)  |
|   W   |   P   |       |       |
|-------|-------|-------|-------|
|       |       |       |       |
|  (8)  |  (9)  |  (10) |  (11) |
|   W   |       |    C  |    C  |
|-------|-------|-------|-------|
|       |       |       |       |
|  (12) |  (13) |  (14) |  (15) |
|       |       |    T  |    T  |
|-------|-------|-------|-------|

W = Wall
P = Player starting position
C = Crate
T = Target

Some examples of maps are in the maps folder.

Used JS libraries

Game art

Art for this game (content of the sokoban/media/graphics folder) was taken from here. All the credit for creating it goes to 1001.com.

Audio effects

Sources:

Game maps

Mos of the example maps were taken from here.

Related projects

About

Clone of the sokoban game made in javascript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages