...

Horror game concept

For my final project in Physical Computing, I developed a horror video game where the player’s heartbeat serves as one of the input methods. The game is top-down horror experience where the player attempts to navigate through a maze-like environment. To complete the level, the player must unlock doors by finding corresponding keys. The player is not alone in the maze, as there are enemies that can sense the heartbeat of the player. By keeping their heartbeat calm, the player can more easily stay hidden from the enemies. Only the immediate surroundings are visible, as everything else, including the enemies, are hidden in total darkness. The enemies cannot be killed, so only way is to avoid them, which requires patience and calculated movements.

Video…

Heartbeat

The heartbeat of the player is tracked with a PulseSensor, and visually presented as a pulsating ring around the playable character. When this ring gets close to an enemy, the enemy will charge towards the player. The player can still escape if they are quick enough. The closer the enemy is the faster their speed will be, eventually catching the player. In this case the player will fall into total darkness and the game will end. To avoid this outcome, the player must time their movements, and navigate past the enemies in between the heartbeats. The enemies can sense the player through walls, which allows the player to safely lure them to more optimal locations.

Game design

The game design process was a great learning experience. I started by ideating and testing different core features around the heartbeat data. I wanted to visualise the heartbeat as directly as possible, to make it unique and personal to each player. The drawback of this approach was in its susceptibility to sensor noise, as rather than simply counting heartbeats, I aimed to visualize the rhythmic pattern itself. As another design choice, I aimed to enhance immersion by integrating all information directly into the game, without the use of a separate HUD. In the current state of the game, this includes having the heartbeat and the collected keys visually integrated on the character. The level progression is designed to be easy to understand, as the locked door and corresponding key are visible simultaneously. Inspired by the themes of heartbeat and blood, the enemy design draws inspiration from leeches and other parasites. This approach results in a simple yet recognisable design that retains its repulsiveness even in pixelated form.

Process

Being unfamiliar with programming and electronics, I learned many practical skills during the process. The game is developed using p5.js, a creative coding library for JavaScript. In addition, the p5play library was used to create sprites, which are individual elements that can interact with each other. This enables the player to collect keys, collide with walls, and die horribly from the enemies. It was also interesting to design simple animations for the characters. These also have purpose, as the idle animations make the enemies more visible from the static environment. I also realised how some simple features can be complicated to implement, for example diagonal player movement, or rotation of the character model. There were also some p5play features that I could not get working, perhaps because the current version is relatively new, and related tutorials were not complete. One of the main struggles involved setting objects on different layers, a feature that should be possible in p5play. Eventually, this struggle led me to give up on implementing a start and end screen. All things considered, I was happy with the results, being able implemented and experimented with all the core features of the game.

Map design

The map design process started with sketching, and soon moved to Photoshop. My aim was to create an intuitive map that introduces the basic mechanics. Some areas are more forgiving as they allow the player to loop around walls. I tried to design the game to discourage aimless running, requiring precise timing for certain encounters. Below is the final map design.

Detail image

Enemy design

The design of the enemies originated from concepts of horror and blood. It had to be something that remains distinct even in a pixelated, top-down view. Leeches and other parasites became direct inspiration, mainly due to their appearance, but also for their desire for blood. I created the enemy design in Photoshop, and then used this JavaScript library to turn them into pixel art. The idle and moving animations both had 6 frames each. Below is the final enemy design.

Detail image

Additions

I also wanted to implement simple quality of life features. The game can be played using either arrow keys or WASD keys. Opening the port connection for the sensor can be done by pressing ‘P’, and full screen mode can be activated with ‘F’. Moreover, the game can be played without a heartbeat sensor by switching to a simulated one with the press of ‘H’.

Pulse sensor

I used a PulseSensor to track the heartbeat of the player. The sensor was simply connected to an Arduino Uno, which was then connected to a computer. There are good official tutorials on how to get data from the sensor for different purposes. It is important to apply a correct amount of pressure towards the sensor, it worked the best when the pressure was just enough to seal the sensor from light. Below is an image of the setup.

Video

Images

You can include and image to your page like this:

![Detail image](./images/circuit.png)

The syntax above is for standard markdown formatting, but I recommend you do it like the example below that makes the image also clickable. Clicking on the image opens up a larger version of it.

[![Detail image](./images/circuit.png)](./images/circuit.png)

Detail image

Table

Component Amount Price Supplier Notes
Item 1 1 0,67€ Item 4 Item 5
Item 1 Item 2 Item 3 Item 4 Item 5
Item 1 Item 2 Item 3 Item 4 Item 5
Item 1 Item 2 Item 3 Item 4 Item 5
Item 1 Item 2 Item 3 Item 4 Item 5