2. Introduction to spygame¶
IMPORTANT NOTE: All graphics used in this documentation and in the spygame.examples.vikings package of the spygame library were taken from the game “The Lost Vikings” (c) 1992 by Blizzard Entertainment Inc. (formerly known as Silicon and Synapse). Please use these images (in your own projects and repos) for demonstration purposes only and then also mention this copyright statement!
2.1. What is spygame?¶
Spygame is a lightweight 2D game engine written in python3 using the pygame library. It’s purpose is to:
- Allow python enthusiasts to reverse engineer their favourite 2D classic games in python.
- Support bleeding-edge AI developments via integration into the openAI toolbox (gym and rllab) and thus allow researchers to test their reinforcement learning algorithms on complex and “reward-sparse” environments.
- Have fun developing new games and game genres using just python.
2.2. Main Features¶
2.2.1. Simple, yet Powerful¶
Spygame is very lightweight. It comes as a single python module that can be installed on your machine
via a simple pip install spygame
.
Spygame uses so called level-tmx files to allow developers to create complex game worlds using the open-source Tiled Editor. You can build a rather complex level from scratch only needing a few background images and sprite-sheets as prerequisites:

2.2.2. Built-In Complex Physics¶
Spygame offers built-in complex platformer physics supporting the following features: - tiles with arbitrary slopes (including stairs options) - jumping - full support for ladders - pushable heavy objects - elevators and moving platforms that one can stand on - built-in game AIs (cliff- and character-detection mechanisms)

2.2.3. Example Levels from “The Lost Vikings” Universe¶
Spygame comes with lots of fully playable example levels, mostly reverse-engineered from “The Lost Vikings” Game (c) 1992 Blizzard Entertainment Inc.

2.2.4. Support for Academic AI and Reinforcement Learning¶
This is still work in progress: Spygame will be fully integrated into the openAI gym and rllab tool sets. One of the core purposes of spygame is to allow running reinforcement learning (AI) algorithms on different computer games in order to help the AI community to test and improve their algorithms.


