Here’s a Sokoban (“box pusher”) clone called Star Pusher. I’ve used the graphics from the Planet Cute collection. You’ll need Python (2 or 3) and Pygame installed to run it. Just download and unzip the files to the same directory. It comes with 201 levels from David W. Skinner.
Download the source code and graphics.
(UPDATE: I’ve updated the code so that it works on Linux. It was due to a \r\n newline issue. I’ve tested the game in Ubuntu and it works.)
The source code is designed to be readable so that new programmers can understand and modify it without much effort.




I had to convert the starPusherLevels.txt file to UNIX line endings before the program would run (in vim, type “:set ff=unix” and then write the file). It complained like this otherwise:
Traceback (most recent call last):
File “starpusher.py”, line 692, in
main()
File “starpusher.py”, line 149, in main
levels = readLevelsFile(‘starPusherLevels.txt’)
File “starpusher.py”, line 447, in readLevelsFile
assert startx != None and starty != None, ‘Level %s (around line %s) in %s is missing a “@” or “+” to mark the start point.’ % (levelNum+1, lineNum, relativePathToThisScript(filename))
AssertionError: Level 1 (around line 24) in /tmp/starpusher/starPusherLevels.txt is missing a “@” or “+” to mark the start point.
NOTE FROM AL: I’ve corrected to code so the newline issue doesn’t happen on Unix.
Posted by Paul Boddie on June 13th, 2011.
What are you using to compile your games with? Py2exe or something that works with python 3?
Posted by Richard on June 15th, 2011.
I’m using py2exe, with mixed results for the Pygame games.
Posted by Al Sweigart on June 16th, 2011.
That’s what I figured. The only thing I can find that works with python 3 is cx_Freeze which seems to work fine for the most part. I just can’t seem to figure out how to get the game to open up without a console opening as well. Actually I did but it also causes some kind of error after I close the game.
Posted by Richard on June 16th, 2011.