Building A Lo Fi “Dungeon Crawler” Using Processing.Py
My kids made a “manual” paper based dungeon crawler game where you move around a game board where the cells are hidden until you “open” a flap. Based on what’s on the cell, you trigger events like loss of health point when you land on a monster or gain of health point if you land on a heart etc.
I thought it would be fun exercise to try and turn this into workable code and hopefully teach my kids some of the “logical thinking” behind how to convert the game rules into a program even if they didn’t actually learn the syntax portion.
(Here’s a preview of the “finished” product”)
If you’ve followed my LinkedIn articles, you know I’ve already made another simple tower defense game in Unity. However especially since this game’s mechanics are relatively simple, using Unity felt like overkill.
Instead, I wanted to see if it could be done in Python. I started looking at PyGame but quickly realised it was not going to be as easy as I thought.
I then went searching for something simpler and found Processing for Python.
In their own words “Processing is not a single language, but rather, an arts-oriented approach to learning, teaching, and making things with code”.
Py.Processing runs on it’s own IDE and each new file builds a “sketch” (literally named as Processing is used to draw stuff). It is
Although the syntax is Python-esque, it is not really Python and instead is built on “Jython”, an implementation of Python that runs on the Java Virtual Machine (JVM), to directly access the underlying Java library. It is also a bit basic as you can’t even import most of the standard libraries into it (eg. No numpy or pandas)
However since I was just after something that would allow me to do some simple drawings/animations and basic GUI-s , it seemed good enough.
Here’s a video where I demonstrate the game and explain (very briefly) how I went about building it.
For anyone interested, the source code is available here:
I want to make a special mention of The Coding Train’s excellent YouTube channel. The energy and enthusiasm that Daniel Shiffman brings to each video is clearly visible and really helped me through the basics of Processing.