Skip to content

gllona/jquery-sokoban

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sōkoban

An implementation of Sokōban in JavaScript, as a jQuery plugin. It parses and runs the de-facto standardized Sokoban puzzle notation, is capable of running multiple games and includes a separate undo buffer for each one. It's about 300 lines of code.

How to use

  1. Include a reference to the plugin (and jQuery) to the <head> section of your document:

     <script src="jquery.min.js"></script>
     <script src="jquery.sokoban.js"></script>
    
  2. Add a Sokoban puzzle to your HTML document:

     <pre class="sokoban>
     ####
     # .#
     #  ###
     #*@  #
     #  $ #
     #  ###
     ####
     </pre>
    
  3. Run the game when the document loads:

     <script>
     jQuery(function($){
       $('pre.sokoban').sokoban();
     });
     </script>
    
  1. Consider adding CSS styles to make the levels look nicer (some are included in the project).

About

Sōkoban implemented as a HTML progressive enhancement jQuery plugin.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published