DEV Community

Ansell Maximilian
Ansell Maximilian Subscriber

Posted on

Turing Complete: A Phaser Game to Celebrate Alan Turing

June Solstice Game Jam Submission

This is a submission for the June Solstice Game Jam

What I Built

Quick deployed game link: https://turingcomplete.netlify.app/

For this challenge, I chose
For this "Juneteenth Jam", I decided to choose Alan Turing as the focal point of my game. He's always due some recognition, especially with all the AI stuff we see today.

Along with Alan, I also chose "progress" as the center theme of this game. Seems appropriate. I wanted to craft a story where Alan Turing was fully appreciated for his work without anyone else's ignorance on other topics dimming the light on his contributions to humanity.

I chose Phaser as the game framework. It was actually my very first time developing a game with Phaser (or maybe even at all).

I learned a lot of concepts and techniques in my journey and it may have resulted in my going overboard in mechanics. I added base-building, story, and even battle sequences.

How the Game Works

Alright, so at its core, your goal as a player is to fix the "Bombe". Located at the northwest end of the map to stop the Enigma from wreaking havoc.

You play as Alan Turing and the gameplay centers around your "Turing Machine". This is your key to progress. You place combinations of tapes (blank, 0, or 1) and create buildings, unlock areas, and even upgrade the machine itself.

Turing Machine UI

Building a cell

That's it! I won't spoil the progression here, but that's the core idea. Your progress is behind the combinations of tapes you put into the Turing Machine. So explore the map and start collecting the tapes.

You start at 1 slot and then you upgrade to eventually unlock 3 slots (which is required to unlock the ending). That's a lot of combinations to try out. For example, is it [0,1,1]; [1,1,1]; etc.

You can even unlock areas with them:

Bridge Not Fixed

Bridge Fix UI

Bridge Fixed

Side Quest

While the main goal is to fix the Bombe, I've provided two additional side quests. One is pretty boring and the other is actually pretty awesome. I invented a minigame that I was quite proud of coming up with.

Collecting Blank Tapes

This one is pretty simple. There are 18 blank tapes spread around the map, and while you only require about 12 to achieve the main quest, you can optionally try to collect them all to finish this side quest.

Battling Data Monsters

Aside from tapes, there are also "Data Monsters" spread around the map. If you get close enough to one, you get sent into a battle scene, where you'll play a minigame to "defeat" said monster.

I've themed this minigame around the Turing Machine somewhat. Here's how it works:

Each battle is based on a simple Turing-machine-style tape system. Alan starts with 40 HP, the Data Monster starts with **48 HP, and Alan also has a **shield value that can absorb some enemy attacks.

Battle Scene

At the start of battle, the player sees the rulebook. The battle has two machine states. The rules can change, while the core mechanics stay, but here is an example:

Stable

  • Reading 1: deal 8 damage to the Data Monster, then switch to Hot.
  • Reading 0: gain 5 shield, stay **Stable.
  • Reading blank: the enemy attacks for 5 damage, stay **Stable.

Hot

  • Reading 1: overload and take 10 direct damage, stay **Hot.
  • Reading 0: cool down, gain 3 shield, switch to **Stable.
  • Reading blank: the enemy attacks for 3 damage, then switch to **Stable.

Rule Book

After the player clicks GOT IT!, the battle enters the execution phase. A tape with 7 cells moves from right to left. The read head always reads the fixed center-left cell. Every **3.5 seconds, the current cell under the head is read, the matching rule is applied, and the tape advances by one cell.

The player does not directly choose attacks. Instead, they drag the current repository symbol into blank incoming tape cells to influence what the machine will read later. The repository only gives 0 or 1, chosen randomly. It shows the current symbol and the next symbol, so the player can plan ahead a little.

Only blank cells to the right of the read head can be filled. This means the player is preparing future inputs before they reach the head.

Damage from normal enemy attacks is reduced by Alan’s shield first. For example, if Alan has 3 shield and the enemy attacks for 5, the shield blocks 3 and Alan only loses 2 HP. Overload damage from reading 1 while Hot is direct damage and does not use the shield.

The battle ends when either Alan or the Data Monster reaches 0 HP. If the Data Monster is defeated, the player wins, the encounter is marked defeated in the overworld, the monster disappears, and Alan receives the reward, currently 1 blank tape part. If Alan loses, the result screen shows defeat and gives no reward.

It's better to check it out on the video.

End Game

Like I said, the ultimate end goal is to fix the enigma machine. I won't go into spoilers on how to do it. If you want a full guide on how to beat the game, watch the video.

Enigma

Basically you want to get to this screen:

Game Over

Video Demo

Code

Here is the repository link. I learned a lot about Phaser game development from this project. It includes things like the Nine Slice Technique, Tilemaps, and many other concepts:
https://github.com/AnsellMaximilian/turing-complete

How I Built It

Okay, so this has been an amazing journey. I learned a lot of concepts in making games in Phaser and some broader framework independent concepts.

I had to learn how to draw tile maps using Tiled, which I found to be such an awesome tool. This was the biggest learning curve for me. I feel like I grew brand new appreciation for those indie devs making beautiful maps.

I learned about layers and collision. I came out of this journey definitely very satisfied knowing I at the very least learned about tile maps.

I also learned about the 9 slice technique, basically a way for you to only have to draw 9 tiles to have UI panels everywhere of any size.

I learned about animating sprites.

How I Approached This

I definitely didn't have a full picture of what kind of game I wanted to make. I knew the theme and the focal point.

I also knew I wanted to center it around the "Turing Machine", and I feel like that really pushed me to think outside the box. I really love the battle concept. I feel like that can be expanded to something bigger.

Prize Category

As you clearly see, I made this game as an Ode to Alan Turing. Everything is centered around him.

I thought it appropriate especially today. You know... the whole "...widely recognized as the father of modern computing and artificial intelligence" thing. Seems really relevant today.

Top comments (0)