A Python library for games based on square tiles.
(c) 2015 Kristian Rother (krother@academis.eu)
Distributed under the conditions of the MIT license. (some artwork covered by a separate license. See ART_LICENSE.TXT for details)
tilegamelib helps create mini-games that have graphics consisting of square-shaped tiles (think Sokoban, Pacman, Tetris, Atomix and their countless siblings).
It is assumed that you have Python 3.6 or higher. The instructions here work for Linux and Windows. I have no idea how pygame works on MacOS.
Follow the documentation of the arcade
library
(requires C libraries, pip might not handle this).
Next, install tilegamelib:
pip install tilegamelib
Set the PYTHONPATH
environment variable to the directory in which this README
file is.
Alternatively, you can try a local installation using pip
:
pip install --editable .
Run the programs in the tilegamelib.games
package. They have a command-line script:
sliding_puzzle
collect_fruit
boxes
snake
pac
See the Beginners Guide
cd test
python test_all.py
Here is an overview of the most important classes
class | description |
---|---|
tilegamelib.Game | Facade for frequently used functions |
tilegamelib.TiledMap | 2D map composed of tiles |
tilegamelib.TileSprite | moving object |
tilegamelib.Vector | x/y coordinates |
tilegamelib.load_tiles | loads tile graphics |
tilegamelib.config | global settings |