2D game engine based on pygame and level-tmx files (soon to be: fully openAI gym integrated)


Keywords
python-3, 2d-game-engine, game-engine, game-engine-library, lost-viking-game, openai-gym, openai-rllab, pygame, reinforcement-learning, the-lost-vikings, tmx-files
License
MIT
Install
pip install spygame==0.1a9

Documentation

Quick Setup Instructions

The Lost Vikings - Sample spygame Level

The Lost Vikings - Sample spygame Level - All graphics are (c) Blizzard Entertainment Inc (The Lost Vikings)

Get the code

Get started

  • write a simple game against the engine:

All you need in order to run this game is the above code in a directory, and the additional subdirectories data/ and images/, which can be found here. These directories contain the necessary SpriteSheets, level background images and level setup (collision layers, background images, position and class of the player, etc..).

This should give you a level like this:

The Maze Runner - An A-maze-ing Game :)

The Maze Runner - An A-maze-ing Game :) - All graphics are (c) Blizzard Entertainment Inc (The Lost Vikings)

You can now control the Agent via the four arrow keys (up, down, left, right).

Next steps

If you would like to create more complex levels (or entire Games with many Screens and Levels), read the spygame documentation, in which we'll create a full-blown 2D platformer Level (sorry, documentation is still very WIP!).

AI (Reinforcement Learning) with spygame

I'm currently working on making spygame available as an openAI-gym Environment type, so that reinforcement learning algorithms can run against any spygame Level objects.

Contribute to spygame

If you would like to contribute to the spygame library, the following items are currently open:

  • add audio/sound support
  • create more example games
  • create more "Lost Vikings" levels
  • create more physics components (apart from the existing top-down and platformer)
  • create support for GUI elements (label, buttons, tick-boxes, etc..). This is an open Pygame problem and should probably be solved on the Pygame level.
  • help out with integrating spygame into openAI-gym and openAI-rllab repos
Lost Vikings - Sample spygame Level

Lost Vikings - Sample spygame Level - All graphics are (c) Blizzard Entertainment Inc (The Lost Vikings)