DEV Community

Thomas Barrett
Thomas Barrett

Posted on • Updated on

Simple Math Adventure Game with PixiJS

Last weekend I wanted to learn more about animations, specifically with the intent to build a game. A quick google search of "best framework for javascript game" brought up a few options, but Pixi.js caught my eye. A fleeting memory of the name crossed my mind and so I followed the link.

I quickly found a list of tutorials and jumped into CJ Gammon's youtube videos. After scratching my head a bit I decided to try kittykatattack's tutorial instead. I followed along, taking in a little at a time, and then trying it out in my own way, and going back to the videos when I needed them.

My experience with animations is limited so I can't make any comparisons, but I was pleased by what I could accomplish with Pixi rather quickly. Within a couple hours (over 2 nights) I had a promising start to a choose your own adventure type game, but I recalled that this type of game would lean heavily on the story, and in the end my aim was to strengthen my coding ability. While I was contemplating where to further my experiment and showing off to my wife she said something that stuck, "It looks like a kid's game." At first I was a little annoyed (that pesky ego of course), but once that moment passed ("moment" === "day") and I took another look I saw what she meant. The icons and artwork I had found all had a soft, welcoming, look and an idea began to emerge.

Since the beginning of school shutdown I struggled to juggle my work and homeschooling. This here might be an opportunity to combine the two. I set off to build a dungeon adventure game that incorporated basic math. Over this last week I spent my nights working on it and feel content with the result. There were plenty of bugs (and still are) but I was able to produce a working game that allows players to choose their adventurer and then solve addition equations to earn action points. Adventurers use the action points to move through a dungeon while avoiding arrows until they reach the other side.

Here is the github repo
And deployed site

There is still much to do (especially in organizing and commenting my code), but if you see any glaring issues or just have a suggestion please let me know.

-Thomas Barrett

Discussion (0)