Our goal this project was to create a game for an installation (built by students from spatial design) that would be played by visitors in the Stedelijk Museum in Amsterdam. The theme that we had to stick to was “Serious Humor” – to take a serious or taboo subject and use it as humor in our game.
In our game, we used the subject anxiety. You are told at the start of the game to buy bananas at the supermarket – which is only a small walk away. However, you have intense anxiety, and when you walk close to someone on the street, they will stare at you until you get a panic attack, and you die. In this project, I mostly took on the task for special effects and user feedback – but since we only had 2 developers and a very limited amount of time, our task range was quite broad.
Technical process
Anxiety meter
The basic gameplay is to avoid your anxiety getting too high – therefore, it’s necessary to keep track of the current “anxiety score” and let the user know (through user interface and more subtle user feedback) what their current state of anxiety is.

The meter itself is fairly simple – the score is stored on the player, and can be added to or removed from with a function. The player keeps track of how many NPC’s are looking at him – the NPC’s only tell the player that they are staring, they don’t add to the score individually – and then adds to the anxiety score based on the amount of NPC’s staring. Once the score reaches a set maximum, a Lose function in the Game Manager is triggered, which loads the main screen.
Special effects
The player can see their anxiety meter rise, but since they are never told it is their anxiety meter, the player needs to know that “meter up = bad”. This is done through user feedback. In this game, I have used the following:
- Vignette and grain
- High peep tone
- Lighting changes
- Spotlight
Code-wise, they are all set up roughly the same. A decimal is calculated between the maximum anxiety and current anxiety. A change in effect starts to appear when the minimum decimal for it has been reached. Then for “fading” effects, like vignette and grain, but also the volume for the peep tone, there is a minimum and maximum vignette/grain/volume decimal. That amount is then spread out over the minimum to maximum decimal for the effect to appear.
Not all effects are that complicated, however. The lighting changes, where the directional light (sun) changes orientation to create a darker or lighter scene, uses a simple linear equation to return a x-axis rotation between certain numbers, based on the current anxiety level decimal.
rotation = -333.33333333333 * dec + 110;
The simplest one is the spotlight. It simply enables or disables at a certain decimal. The spotlight itself uses a light cookie, to make it look more cartoon-ish than the standard light.
NPC movement
I also created the movement for the people walking on the street. For this, I used Sebastian Lague’s Bézier Path Creator. I had to create my own path follower script, to make the orientation work correctly, but this saved a lot of precious time.
The rest of the NPC’s code is simple: when the target is in range, they face their target, and their speed is multiplied by a number. This can be used to make them walk slower when their target is in range. However, we ended up using 0, to make them stand still instead.
Here are some GIFs where you can see it in action, in a more schematic way:




The GitHub for the project can be found here.