Giter Club home page Giter Club logo

sokoban.vim's Introduction

VimSokoban

image

The goal of VimSokoban is to push all the packages into the home area of each level using the cursor movement keys. The keys move the player in the corresponding direction. If a package is in the way it will be moved too, if there's an empty space beyond it. Packages can only be pushed. If you get stuck, you can undo your moves or restart the level.

Starting the Game

Use any of the following commands to start a game. <level> is an optional parameter that lets you select the level to play in the current set of levels. If not supplied, you will resume at the last level you played.

  • :Sokoban <level> (no split window)
  • :SokobanH <level> (horizontal split window)
  • :SokobanV <level> (vertical split window)

Keys

These are the keys you need to use when playing the game.

Key Function
h or Left Move Left
j or Down Move Down
k or Up Move Up
l or Right Move Right
u Undo Move
r Restart Level
n Next Level
p Previous Level
0-9 Select any level by number typed.
s Choose a level set to play

Customizing

  • The plugin uses Unicode characters that may not display well in your font. You can customize them in your .vimrc file like so:
let g:charWall          = '#'     " Default: '█'
let g:charSoko          = '@'     " Default: '◆'
let g:charPackage       = '$'     " Default: '○'
let g:charHome          = '.'     " Default: '◻'
let g:charPackageAtHome = '*'     " Default: '◼'
  • The path and name of the high score file is in the variable g:SokobanScoreFile. It defaults to .VimSokobanScores in the plugin's root folder.

More Levels

Additional level sets can be downloaded from the very long list on the http://www.sourcecode.se/sokoban/levels webpage. Choose the option to download as an XML file; it will have an extension of SLC. These collections range wildly in terms of size, difficulty and number of levels.

The SLC file needs to be converted before it can used by this plugin. Run the :SokobanConvertSLC command while your cursor is in the SLC buffer. Check the resulting JSON for errors, and then save the buffer as a JSON file in the plugin's levels folder. If you would like to contribute to VimSokoban by converting more SLC files to JSON, please do by submitting a pull request.

Reference

More information about Sokoban can be found on its Wikipedia page.

sokoban.vim's People

Contributors

philrunninger avatar

Watchers

 avatar  avatar  avatar

Forkers

mfilser

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.