For years I have had a belief that there was a way to create a videogame that helps people learn the fundamentals of software design. At our sister software company, Sumo Software, we have discussed how this could work; we even have a game in the works to help introduce people to logic through puzzles. It is a start, but how do you integrate actual CODE into a videogame?
Apparently by just going right for it and designing your puzzles around understanding a block of code and interacting with its public properties and methods. That is exactly what Code is all about. Created by Trevor Rice, John Bair, and Daniel Romero-Quiroga for Richard their Experimental Game Design course at the University of Southern California, the game was submitted to IndieCade, and brought to my attention from there.
The game premise is simple: you control an @ symbol, in your case representing a memory leak, trying to escape from the evil garbage collector. You accomplish this by progressing from level to level by working through code puzzles, interacting with them as if you are outside code interacting with an object.
People who have actually played with Unity or C# go, 'Oh, is this C#? This seems like C#. The actual levels themselves were originally laid out just like the code for C# but we kind of made them a weird pseudo-code because there's a lot of information that confused players or didn't necessarily matter to the level itself.
Considering how many people have experience with a C language, especially JS or C3, it makes sense to model in that realm. The levels, however, are purposely not considered as code from the beginning, either. Bair, who is more of a designer than programmer, will come up with an idea,
What if here you have to tick something to a specific number and then that unlocks that door that then you can go through to beat the level?
That concept is then turned into pseudo code,
There's an integer variable that you can then adjust and then we have the Boolean that's private so the player can't change that. By changing the integer value it unlocks the Boolean which then takes you to the next level.
Now, if this all sounds like craziness to you, don't worry - the game walks you through the concept as you play. The hints are disguised as code comments and littered throughout the game. I have played the game demo, available at the link above, and playing it is definitely well worth the time, whether you know anything about programming or not.