Building a Microgame: You Killed a Bear

I have always wanted to try my hand at building a game, but have never seriously gotten around to it. A big part of the reason for this is that I have precisely no artistic abilities and know that no matter how long I spend building pieces of logic that I’ll inevitably struggle and get frustrated when dealing with music, graphics, etc.

For this reason, I was super delighted when I saw 24a2 appear on Hacker News. 24a2 is

24a2 is a simple game engine that lets you to build a game in a few hours. It has a very limited set of features which makes it easy to learn, and encourages you to solve problems creatively.

In fact, 24a2 gives you access to a 24x24 grid of dots, and gives you the ability to change their color to one of 8 or so different colors in response to arrow key presses, or mouse clicks.

24a2 banner

Pretty much immediately, a few things fell into place for me. First I wanted to see if I could create a game in just a couple of hours, and second I realized that I had already written most of the code I would need. Back in 2018 I was invited to display some of my pen plotter art at the Chicago art/open mic even, Makespace.

My art at Makespace

As part of this, I made some images of autogenerated mazes. I ran out of time before completing my final goals, which was to have the plotter draw some impossibly complex mazes, then flip over to drawing in red and solve those impossible mazes faster than the human eye could follow. That said, I did manage to build a decent maze generation alrogithm in Python. It took only a quarter hour or so to port the algorithm into TypeScript, then another couple of hours to set up 24a2 to render the maze and allow me to move a dot around it. I then added an “exit” to the maze, but the game just wasn’t in the slightest bit entertaining. It’s almost trivially easy to solve a 24x24 maze by eyeballing it, so I added some line of sight effects. Still too easy, you would always find your way to the end, even if there were a couple of false starts, so I finished up by adding some time pressure. Namely, I made the game color in every square you trod on in red. Initially I was thinking of having it so that you had to get to the end without stepping on any square more than once, but that was impossibly hard to do, but around then I realized that the red dots in your wake looked like a trail of blood so “You Killed a Bear But Now You’re Bleeding To Death: The Game” took shape. Get out of the maze before your character loses too much blood and faints.

And here it is.

The final state of a YKAB game (fail) The final state of a YKAB game (win)
comments powered by Disqus