A number of games including “Elemental: the Recurrence”, Wu’s Castle [64], The Cata- combs, Saving Sera [49] (among other games) from the Game2Learn group [56] are de- signed to teach the player various computer programming concepts. These games teach simple programming involving arrays, loops, recursion, and tree traversal.
Wu’s Castle [64] teaches the concepts of arrays and loops. This game consists of two sub-games. The first involves array manipulation. In this sub-game, the player creates ar- rays of different types of “snowmen”. The player is first presented with for-loop parameters (using C++ syntax) which they are allowed to change. Then the player chooses the loop body from a menu of choices. A game character then acts out the loop execution in a visual manner. A series of “missions” are presented to the player. Each involves creating certain types of snowmen in the cells of either a one-dimensional or two-dimensional array. Once the player successfully completes one “mission” they are allowed to proceed to the next. In the second sub-game, the player avatar can interactively walk through a game level which represents the execution path of a loop. As the avatar moves, the game reports which part of the loop’s code is being “executed”. The authors report that playing the game before solving homework programs helped students “create a deeper, more robust understanding of computing concepts.” The gains were even greater for more difficult problems [64].
“Elemental: the Recurrence” is a game designed to teach the concept of recursion. The player is asked to write several programs in C# to recursively guide an avatar. The avatar collects tokens (which represent portions of the avatar’s sanity) by visiting nodes in a tree structure. To collect all of tokens, the avatar must successfully perform a depth
Participants in the study completed a pre-survey, played the game for 40 minutes, and then completed a post-survey. The surveys contained five questions directly concerning recursion (the questions were not published). “Elemental: the Recurrence” wraps a simple game around typical homework assignments. This provides effective motivation (beyond receiving course grades) for the player to complete the assignments. The game was shown to be effective in improving learning outcomes [56].
All of these games from the Game2Learn group suffer from the fact that the program- ming tasks are “separated” from game play. The concepts to be learned are not an inherent part of the game world. This forces the player to “switch roles” between playing and pro- gramming during game play [146]. This is related to the idea of “gratuitous incidents” described by Laurel [115]. These are “incidents which have no direct bearing on the plot” or outcome of the story. These kinds of incidents are often exhibited in an effort to “provide intrinsic motivation in educational programs by interspersing problem-solving or tutorial segments with pieces of games.” [115].
These are not “fatal” flaws however. Each of the games has been shown to be effective in improving learning outcomes. Our major criticism of this approach concerns game play (In role-playing games, sorcerers do not code in C++). If the goal of the video game is to teach computer programming in a more or less direct fashion then new programming languages should be designed which fit and match the world design of the game. Another minor criticism is that these games are tied to a specific programming language. It may be difficult to modify the games for use with another language.
In the game Lightbot (produced by Armor Games), the player is presented with a series of puzzles [22]. The puzzles require the player to write simple programs using a graphical
language to make a robot move and “light up” designated goal tiles in a simple world. The language is simple and has a small number of commands: move forward, turn left, turn right, jump, and light the current square. There are no mechanisms for iteration or condi- tional statements. Each command is represented by a tile (with an appropriate graphical symbol) and programs are described by creating sequences of these tiles. The program can also include two user-created functions and there are command tiles which allow the in- vocation of these functions. The functions do not allow parameters (there are no variables in the language). The puzzles are challenging because the user-created functions and the overall program cannot consist of more than 28 instructions total (12 in the main function and 8 each in two other functions). This limitation is particularly important because there is no construct for performing iteration. Because it is not possible to pass function parameters and there are no conditional statements, it is not possible for Lightbot programs to contain recursive functions.
Since the goal of Lightbot is to control the robot using a program the player does not have to “step out of the game” while playing thereby avoiding the “magic circle” problem [146]. Creating the program is an integral part of the game itself. This is the result of good game design. The simplicity of the design along with the immediate graphical feedback of the program effect create considerable player engagement and interest.
The sequence of puzzles is also well-designed. First a number of tutorial puzzles are presented which teach the player the purpose of each command tile and how to create programs. After these basic puzzles the difficulty increases steadily. Each new puzzle requires more creativity and careful thought than the earlier puzzles. This further increases
the level of player engagement. It is this high level of engagement and simple design which make Lightbot interesting pedagogically and worth further study.
The sequence of Lightbot puzzles probably improves understanding of command se- quences and some aspects of functions (particularly code reuse and invocation). The game cannot improve understanding of variables, iteration, or conditionals since the program- ming language does not include these features. We are not aware of any educational studies involving this game.