Home

Awesome

Sokoban Player

Sokoban Player provides best experience to play any sokoban level you want!

Play it here

Contributing

This app is based on create-elm-app. Here are steps to set it up for yourself.

To build app

To build SVG sprite

Run tests (optional with watch)

Pull requests are welcome!

Some docs

Level data structures and transformations

StringLevel and ShortStringLevel

Based on Sokoban Level Format level can be defined as a string in 2 formats, normal and short. This is one of possible entry formats.

#######
#.@ # #
#$* $ #
#   $ #
# ..  #
#  *  #
#######
7#|#.@_#_#|#$*_$_#|#3_$_#|#_2.2_#|#2_*2_#|7#|

XML Sokoban format, game elements are represented with the same characters as in string format. Another entry format.

<Level Id="soko42" Width="7" Height="9">
    <L> ######</L>
    <L> #    #</L>
    <L>## $  #</L>
    <L>#  ##$#</L>
    <L># $.#.#</L>
    <L># $...#</L>
    <L># $####</L>
    <L>#@ #</L>
    <L>####</L>
</Level>

Intermediary structure to standardize all entry formats. id is a EncodedLevel

level : Level
level =
    { width = 5
    , height = 3
    , map =
        [ [ '#', '#', '#', '#', '#' ]
        , [ '#', '@', '$', '.', '#' ]
        , [ '#', '#', '#', '#', '#' ]
        ]
    , id = "5AHABDFAH5A"
    }

Is created always directly from Level and is used to keep and update level elements in Model.

viewLevel : ViewLevel
viewLevel =
    { player = Block 1 1
    , walls = [ Block 0 0, Block 1 0, etc. ]
    , boxes = [ Block 2 1 ]
    , dots = [ Block 3 1 ]
    , gameSize = ( 5, 3 )
    }

This is ShortStringLevel format mapped to more url-friendly symbols, see table below.

7AHAFBGAGAHADEGDGAHA3GDGAHAG2F2GAHA2GE2GAH7AH
elementsokoban formaturl encoded
wall#A
player@B
player on dot+C
box$D
box on dot*E
dot.F
floor_G
row separator|H

License

(c) Copyright 2018 Kris Urbas @krzysu, all rights reserved.

This game is open sourced for learning and recruitment purposes. Do not use for profit!

Original Sokoban game written by Hiroyuki Imabayashi © 1982 by THINKING RABBIT Inc. JAPAN.

Game assets by <a href="http://www.kenney.nl/">Kenney.nl</a>.