For our controller, we finalized the Mask concept for the game Spooky's Jumpscare Mansion. The mask itself is inspired by the mask of Jason Voorhees from the Friday the 13th series, an iconic look for horror in general. This fits in with Spooky's as it is a game that lovingly pays homage to all sorts of horror media.
In order to move forwards or backward, the player must lean in that direction away or towards their monitor. This is done using an ultrasonic sensor on the forehead. This play's into the games jumpscare focus as being closer to the monitor will make the jumpscares that much more impactful. On both sides of the top of the mask are a switch and a button. The button will allow the player to use the interact feature while the switch is a toggle to enable constant sprinting. On the cheeks area of the mask, two parallel switches are placed that allow for camera control, one being horizontal and the other being vertical. Finally, on the mouth and chin of the mask are a microphone that transfers sound into an attack input, and a button that allows the player to pause the game.
//Final Group 13//Aiden Pain, Victor Farrulla#include <Adafruit_CircuitPlayground.h>#include <Adafruit_Circuit_Playground.h>//declare variables for analog read valuesvoid setup() {// start CircuitPlayground and Serial MonitorCircuitPlayground.begin();//set pin mode for pins attached to sensors and buttons//read current environment sound and set a variable to act as the baseline for microphone inputSerial.begin(9600);delay(1000); //wait for setup}void loop() {//set a variable that corresponds to the ultrasonic sensor's reported distance// (map it so it's negative when leaning backward, positive when leaning forward, and zero for staying still)//use if-else statements with that variable to press S if negative, W if positive, or neither if zero//set a variable that corresponds to microphone input//if the microphone input is significantly higher than the environmental baseline, press left-click (to attack)//set a variable that corresponds to the interact button//if the voltage reads high and wasn't previously high, press the E key (to interact)//set the chin button's previous state (to compare to the next read)//set a variable that corresponds to the sprint switch//if the voltage reads high, hold the left-shift key (to sprint)//set a variable that corresponds to the chin button//if the voltage reads high and wasn't previously high, press the escape key (to get to the pause menu)//set the chin button's previous state (to compare to the next read)//set a variable that corresponds to the potentiometers via analogRead//map potentiometer values to mouse move-friendly values//send the mouse move signals - left/right for one potentiometer, up/down for the other}


No comments:
Post a Comment
Note: Only a member of this blog may post a comment.