Skip to main content
Have a personal or library account? Click to login
Finding the ‘Magic’ in Programming Games: A Critical Digital Humanities Approach to Studying Video Game Code Cover

Finding the ‘Magic’ in Programming Games: A Critical Digital Humanities Approach to Studying Video Game Code

Open Access
|Aug 2026

Figures & Tables

Table 1

The phases and steps for analysing source code using a ludemic approach.

PhaseStepDescription
1Play AnalysisPlaying the game and noting what affordances are offered to the player in order to be able to play the game.
Formation of LudemesReviewing notes and clustering of mechanical and aesthetic aspects into small units of gameplay.
2Distant Reading CodeExploring the entire codebase with the help of text manipulation tools according to the ludemic vocabulary.
Mapping Ludemes in CodeSorting the findings into a format which can be reviewed and analysed towards its structures.
3Close Reading CodeReading through findings regarding stylistic and semantic values.
Analysis of FindingsContextualising findings and relating them within the given structures and their paratextual material. Critical analysis in relation to the research questions and semiotic transfers.
Figure 1

Zozo crushing the green chemicals block into a non-functional block in order to clean up the environment and win this level. Screenshot by the author.

Figure 2

Zozo looking at us, awaiting further instructions. Screenshot by the author.

Table 2

List of the constructed ludemes and their descriptions.

LudemeDescription
AvatarThe character that we control during gameplay: Zozo.
MovingMoving our character through keyboard or other hardware input.
ExploringA game loop in which we move our character around to learn more about the environment and how we relate to it.
BlocksThe main object with which we interact in order to reach the game’s given goals is by removing some of them.
PushingThe main way of interacting with blocks.
RemovingRemoving is a core mechanic of the game, but it depends on moving and pushing the right way. In more complex arrangements, removing a block involves several steps, akin to a puzzle, to successfully close this game loop.
MonstersThese non-player characters create additional challenges, since a collision with them knocks the avatar out, and make the moving and pushing mechanics more difficult. They can be removed by pushing blocks into them.
EvadingThe act of trying to accomplish the core goal of removing enough blocks while not being hindered by the monsters.
Heads-up DisplayThis user interface on the right side tracks vital metrics about our progress toward our goal of removing enough blocks within the given time. It is an extradiegetic ludeme that is nonetheless crucial for playing the game.
Listing 1

Example of the grep command to search the code for the avatar.

Listing 2

Abbreviated output of the grep search command. The number on the left is the command output, which indicates the line number in the code.

Table 3

List of relevant pieces of the assembly code regarding the ludemes. Commentaries in quotes are verbatim taken as found in code, whereas the rest are notes made by the author.

LudemeLinesCommentary
Avatar254Coordinates variables
689‘dessine un sprite sous controle du Controller’
1349‘Sprite Controller (interface pour l’utilisateur) (max. 20 sprites)’
Moving272Moving and pushing variables
652Collision control
4224Joystick routines
4353Input flags that keep the player’s choice of direction
4411Reading input keys or controller
Transporter6060‘Transporter’, which is a teleporter
Teleporting6155Teleportation
Blocks885‘Dessine tout l’ecran de jeu (Background+Blocks)’
6238Block rules
Pushing272Moving and pushing variables
4430Reading push and checking if pushable
4905Initiate destroying block ‘.ArbitreCrash’
Table 4

Analogous to Table 3 for the Python source code.

LudemeFileLinesCommentary
Avatarpoizone.py1175Rendering Zozo
Movingpoizone.py799Reading direction input
Transporterglobals.py151Teleporters are initiated via land data
Teleportingpenguin.py390Check if on the teleporter and react accordingly
Block(s)constants.py115Block class and types
penguin.py102Block rules
poizone.py623Rendering background and blocks
Pushingpoizone.py842Reading controls
penguin.py61Push block
Figure 3

An example of a visual mapping. Above are code snippets and their connections to the original game’s codebase; below are the corresponding samples from the ported version. The ludemes visualised here are avatar, moving, blocks, and teleportation. A large-scale version of this mapping is accessible in the accompanying open-access analysis data repository.

Listing 3

Example of comments and variables in the original game’s assembly code.

Table 5

List of the lines of code that relate to the moving around ludeme.

LinesCommentary
4224–4250Checking if the player has a joystick plugged into the computer and is using it.
4284–4305Reading the input of the joystick.
4325–4338Defining which keyboard keys would be used for which of Zozo’s actions.
4353–4356Initiating the player flag. This variable is used to track which keys the player pressed.
4379–4419The ‘.MovePengi1’ routine prepares the game to move Zozo by putting all the variables in place.
4411–4412Preparing the player flag before checking which keys were pressed.
4412–4459These roughly 50 lines of code in the ‘.LEFT’ routine were copied and minimally modified for all four directions Zozo can move. They check whether Zozo can move in that direction as well as whether the penguin is colliding with a monster. There is also a check for whether there is a block in that direction and how we interact with it.
Listing 4

Example of the commenting style in the ported game’s Python code.

Table 6

List of the lines of code that relate to moving Zozo, but this time in the game’s ported version.

FileLinesCommentary
poizone.py759–772Checking if a joystick or joypad is connected and remembering that relation in the ‘joy’ variable.
poizone.py799–807Asking for the current state of the input device. This simply saves the directions the player pressed in ‘keyDown’.
poizone.py1041Player intention is fed into the avatar’s ‘update’ function.
penguin.py279–479Handling all the logic that is related to moving.
poizone.py1175Re-rendering Zozo on screen.
DOI: https://doi.org/10.18146/tmg.943 | Journal eISSN: 2213-7653
Language: English
Page range: 1 - 32
Published on: Aug 13, 2026
Published by: Sound & Vision
In partnership with: Paradigm Publishing Services

© 2026 Adrian Demleitner, published by Sound & Vision
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 License.