(an object oriented python game for the PewPew Platform)
This repository contains the Maze Runner project. It is a small game written in Python for the PewPew Platform.
First of all it has to mention that this is my first Python project for which I had to script more than two lines of Python code. So it should not serve as a reference for well written Python code. As the focus was rather on a clear functional structure, I decided to take an object-oriented approach.
This repository has the following structure:
|- Projekt
|- config/
|- doc/
|- lib/
|- maze_runner.py
|- README.md
|- README_de.md
-
config: This folder contains the demo configuration including all game levels (i.e. stages) and a README file with a description of how to design and implement your own configurations.
-
doc: This folder contains a single OpenOffice Calc file. You can use this file as a template for your own maze configurations.
-
lib: This folder contains the all the Python scripts used for the Maze Runner game logic as well as one README file per Python module with some explanations about the classes.
-
maze_runner.py: This is the main module that is executed by the PewPew code. A GameController instance is created (c.f. 'lib' README) that loads a given configuration (c.f. 'config' README) and updates its state in a loop.
-
README: This file contains an overview of this repository and an installation / deployment description for the Maze Runner game. It is available in english and german.
Basically, you have two options to install and deploy the Maze Runner game:
-
PewPew Board: To execute the code on a PewPew Board, you first have to connect your board with your computer over USB. Then copy the two folders 'lib' and 'config' as well as the main module 'maze_runner.py' to the automatically mounted PewPew board and (re)power the board. ** Attention - not tested yet! **
-
PewPew Emulator: The Maze Runner game can also be executed using the PewPew Emulator. To do so, you have to install 'python3' and the Python3 package manager 'pip' on the development machine and follow the installation instructions of the PewPew Emulator README. After a successful installation, the two folders 'config' and 'lib' as well as the main module 'maze_runner.py' have to be copied into the 'Pew Pygame' folder and the game can be deployed by executing the 'python3 maze_runner.py' command in a console. Under Linux with root privileges (
sudo
orsu
) run the following commands in a terminal:
$ sudo apt-get update
$ sudo apt-get install git
$ sudo apt-get install python3
$ sudo apt-get install python3-pip
# without root privileges
$ git clone https://github.com/pewpew-game/pew-pygame.git
$ cd pew-pygame
$ python3 -m pip install -r requirements.txt
# copy 'lib', 'config' and maze_runner.py into the current folder
$ python3 maze_runner.py
It is recommended to use the PewPew Emulator for the further development and the implementation of your own configurations, because it then is possible to debug the Python scripts for the PewPew board with the python method print( ... )
.
All files in this repository are free software and can be used under the terms of the WTFPL License (c.f. http://www.wtfpl.net). The code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.