Documentation

Description

The story follows a boy trapped in an endless nightmare, tormented by the ghostly memory of his toy teddy bear, Mr. Teddy Bear. The player’s goal is to evade Mr. Teddy Bear’s attacks across two levels:

  1. In the first level, Mr. Teddy Bear attacks from the left, front, and right. The player must anticipate these attacks by directing their flashlight towards the incoming threat, using the sound of a bell chiming from that direction as a warning just before each attack occurs, as the player is blindfolded.
  2. The second level involves navigating a maze using three light sensors: the front sensor to move forward, the left sensor to turn left, and the right sensor to turn right. If the player strays outside the designated path, they lose a life, and the maze resets. To help the player maintain awareness of the boundaries, an audio cue in the form of a bell will indicate the direction of the near boundary/boundaries.

Additionally, there is a brief tutorial level at the beginning to test the functionality of the light sensors and to provide context between each level.

Inspiration

Inspiration

Five Nights at Freddy’s

The maze level is inspired by a level in Five Nights at Freddy’s Sister Location: video link

Credits

Technicality

P5.JS: Link to code

Arduino Code


int frontPin = A0;
int leftPin = A1;
int rightPin = A2;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  while (Serial.available() <= 0) {
    Serial.println("hello");
    delay(300);
  }
}

void loop() {
  // put your main code here, to run repeatedly:
  int frontPinState = analogRead(frontPin);
  int leftPinState = analogRead(leftPin);
  int rightPinState = analogRead(rightPin);
  if (Serial.available() > 0) {

    if (frontPinState > 200) {
      Serial.print(1);
    } else {
      Serial.print(0);
    }
    Serial.print(",");
    if (leftPinState > 200) {
      Serial.print(1);
    } else {
      Serial.print(0);
    }
    Serial.print(",");
    if (rightPinState > 200) {
      Serial.println(1);
    } else {
      Serial.println(0);
    }
    delay(30);
  }
}
     

Physical Circuit

Physical Circuit Physical Circuit Physical Circuit

Reflection

Areas for Improvement