background preloader

Python

Facebook Twitter

Pyvideo.org. The "Invent with Python" Blog — New Game Source Code: Star Pusher (Sokoban clone) Here’s a Sokoban (“box pusher”) clone called Star Pusher.

The "Invent with Python" Blog — New Game Source Code: Star Pusher (Sokoban clone)

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. Style Guide for Python Code. Code should be written in a way that does not disadvantage other implementations of Python (PyPy, Jython, IronPython, Cython, Psyco, and such).For example, do not rely on CPython's efficient implementation of in-place string concatenation for statements in the form a += b or a = a + b.

Style Guide for Python Code

This optimization is fragile even in CPython (it only works for some types) and isn't present at all in implementations that don't use refcounting. In performance sensitive parts of the library, the ''.join() form should be used instead.