Android Applications

Sokoban

Download

The latest version (version 1.6) of the game can be downloaded from here.

The change history for the application can be found here.

Game Description

The Sokoban game is a puzzle game originally written by Hiroyuki Imabayashi. This version was written to be able to play Sokoban levels on the Android platform. Here are the features of this version:

Instructions

Each puzzle collection consists of a number of levels (usually of increasing difficulty). The goal of the level is to push all the objects over the goal squares. Since you can only push objects you may need to plan your moves well in advance.

The table below shows each of the items you will see on the playing field:

Icon Description
This is your location when on a regular game square.
This is your location when on a goal square.
This is an object as it appears on a regular game square.
This is an object as it appears on a goal square.
This is an empty regular square.
This is an empty goal square.

The following shows the various wall segments surrounding floor spaces. These wall segments will constrain where you can move or push objects.

You can control play during the game by using any of the following keys (note that all these are also available from the game play menu):

Key Description
space By pressing the space key you can pause the game. This will halt the timer and hide the puzzle on the screen.
R The R key will reset the level and timer.
U The U key will undo the last move.
D The T key will redo the last undone move.
N The N key will go to the next level in the puzzle collection.
P The P key will go to the previous level in the puzzle collection.

Moving around the game board can be accomplished by several mechanisms (depending on the nature of your android hardware). You can use the arrow keys, the trackball, or the touch screen. When using the touch screen there are several different modes that can be employed (based on your preferences).

Touch Screen Modes

Move on Touch

The default mode for the touch screen is for the pusher to move (or push) to the location selected by the touch screen. For devices with accurate touch screens this can be very fast. Long distance pushes are done only in a straight line and the object being pushed will only move as far as the target square.

Move on Release

By selecting to move on the release of the screen you can move your finger/pointer around on the screen until you see that the outlined target square is the desired location. When you release the pointer (by picking your finger up from the touch screen, for example) then the game will try to move or push to the target location where you released the pointer. As you move around on the touch pad the target cell will be highlighted with a copy of the man icon transparently over the various target cells. Depending on how much your pointing device blocks the screen you may or may not be able to see the target location.

Scroll on Touch

If you prefer to only use the touch screen to indicate which direction the man should move then you can select to move via scroll motions. To use this mode after selecting it in the preferences you simply drag your pointer across the touch screen in the direction you wish the man to move (up, down, left or right). The man will then move or push one position in that direction.

Move on Double Touch

As an alternative to the default move on touch mode you can ask that moves be made after confirmation of the target cell. This requires you to touch the same spot on the touch screen twice before the man will move or push there. When you touch the screen the first time a transparent copy of the man will show on the target cell (if it is a valid move/push target). If the spot is correct then simply tap the touch screen in the same place again. If it is incorrect simply tap the correct square to move the highlighted target to the correct cell and then tap the correct square a second time.

XML File Format

If you want to upload new collections into the game, then you need to follow the following XML format.

<collection>
 <title>Collection Title</title>
 <description><![CDATA[Put collection description here.]]></description>
 <email>author_email@google.com</email>
 <www>http://author.website</www>
 <levels>
  <puzzlelevel>
   <name>Puzzle Name</name>
   <level>level #</level>
   <puzzle><![CDATA[    #####
    #   #
    #$  #
  ###  $##
  #  $ $ #
### # ## #   ######
#   # ## #####  ..#
# $  $          ..#
##### ### #@##  ..#
    #     #########
    #######]]></puzzle>
  </puzzlelevel>
 </levels>
</collection>

The puzzle description itself is one used commonly on the Internet to define a Sokoban puzzle. The table below describes each character and what it means.

Char Meaning
<space> Either an empty square inside the puzzle or empty space outside the puzzle.
# A wall section.
@ The starting position on an otherwise empty square.
. An empty goal square.
$ An object on an otherwise empty square.
+ The starting position on a goal square.
* An object on a goal square.

The puzzle description above is the common starting puzzle as shown below