22 October 2023

Scaffolding - Progress Review: FNAF 4 Flashlight Controller

1)  For my game controller, it is going to be for the game Five Nights At Freddy's 4, and will be in the form of a flashlight. The flashlight has always been an icon in these FNAF games as, aside from the doors and in earlier games the cameras, it is the only tool you really can use to seek out or stop the incoming animatronic threats, and is especially important in FNAF 4. Now the only controls here would be for the closing of the door, the flashlight, and also moving using the mouse at certain portions of the screen for where you need to move. I do have the accelerometer being used for mouse movement and also for Select (LMB), the potentiometer is for the flashlight, and a sound sensor for the door closing and opening(this may be changed due to certain game mechanics). I may change door to be used by potentiometer as well, if functions do not work out or become too complicated.

Schematics



Pseudo Code


Scaffolding: Progress Review - Super Mario Kart Game Controller

 This controller's final design comes in two parts. It consists of a pedal for acceleration, which is controlled by your feet, and a main handheld game controller which uses the Circuit Playground's accelerometer in order to track steering. When stepping on the pedal, it pushes a powered LED towards a light sensor, which if the LED gets close enough, will trigger the game's acceleration aspect. As for the steering, which is tied to the accelerometer, the steering will be read based on the accelerometer's Z axis value. When the controller is tilted to the left, you will steer left, and when it is tilted to the right, you will steer right. When the controller is left in the upright and leveled position, you will go straight. The switch on the top of the controller will be to turn the controller on and off (especially for debugging). 

Some wires may be seen traveling from the accelerator box to the main controller, however there will be no exposed wire ends or components. A cover will also go over the front of the controller such that the Circuit Playground can be easily accessed and hidden.





Scaffolding: Progress Review - sword controller

 

For my controller, I decided to continue with the sword that will be used to play Deepest Sword. This controller is housed inside of a short sword and has some basic functions to play the game. I chose the concept of the sword to place the player in the shoes of the knight on his quest to slay the dragon at the end of each puzzle. On the sword, there will be one button that will be used for the restart function and also as a way to assist in the triggering of the sword swings to navigate through the puzzles. To control the left and right movements, there is a potentiometer placed on the front of the sword. Rotating it to either side will trigger the player’s movements. Inside of the sword is where a gyroscope will be housed. The gyroscope will be used in conjunction with the singular button as a way to swing the sword in a particular direction. Rotating the sword to the right while holding the button down at the same time will cause the sword to swing clockwise while rotating to the left will swing counterclockwise.



Pseudocode:



Scaffolding: Progress Review

Unique Game Controller - Beer Keg

I chose to make a beer keg controller for the classic game called Tapper. Tapper is a classic game that allows you to take control of a bartender and start serving and collecting beer and tips for and from your customers. My intent is to make you really feel like you are a bartender during rush hour. The keg is designed to mimic an actual beer key, I want it to be a scale model of it. The design of the keg allows you to pull the lever to pour the drinks along with a motion sensor to tell if you are facing either the left or right. Then the potentiometer is used as a way to move up and down. 

                                                                            Design


Circuits
Pseudo Code

/*
Install Adafruit playgrounnd to Arudino
Add Circuit Playground Library

Add Potientometer Library and define it
Add PIR Motion Sensor Library and define it
Add
*/


void setup() {
  //Add CircuitPlayground.begin();
  //Add Keyboard.begin();
  //Initialize the Motion Sensor and the Potientometer giving base values for it
}

void loop() {
  //Add loop to control Accelometer when only going Up or Down
  //When up press Keyboard.Spacebar and when down no click

  //Add loop to control PIR motion Sensor
  //When light sensor is below a certain value, keyboard press left arrow
  //When light sensor is above a certain value, keyboard press right arrow

  //Add loop for Potientometer
  //When Potientometer is turned move player up or down depending on direction

}

Scaffolding: Progress Review

 I chose to make the shoe controller for the video game Sonic the Hedgehog. My intent with the controller design is to turn an ordinary shoe into a fun and unique way to control the game in a way that made it feel like you were in the shoes of Sonic himself. The design has you tilt the shoe forward in order to move right, tilt it backwards in order to move him left, and finally to lift it off the ground in order to make him jump. This control scheme is intended to be handled with an accelerometer, a gyroscope sensor, and a proximity sensor. Although it will be a wired controller, I am also interested in seeing if I could potentially make it wearable.

Sketch:


Schematic:


Pseudo Code:

#include <Adafruit_CircuitPlayground.h>
#include <Adafruit_Circuit_Playground.h>

void setup() {
  // put your setup code here, to run once:
  // define gyroscope and proximity sensor
}

void loop() {
  // put your main code here, to run repeatedly:
  // include if statement for gyroscope detecting left and right movement
  // include if statement for proximity sensor value to activate jumping
}


Scaffolding Review: Cookie Clicker the Clicker controller

So my controller aesthetically wants to match the game itself so what better way than that by making the controller look like the game itself, it makes the game which is usually dull of just clicking over and over with your mouse to now become a interactive game as we click the cookie in the game with a cookie itself outside of the game, so we put the cookie together with both halves to click on the cookie in the game meanwhile to just make it more interactive you have to break it apart everytime to make the cookie click again!


 






const int pResistor = A0:

const int xAxis = A1;         //analog sensor for X axis
const int yAxis = A2;         // analog sensor for Y axis

int range = 12;               // output range of X or Y movement
int responseDelay = 2;        // response delay of the mouse, in ms
int threshold = range / 4;    // resting threshold
int center = range / 2;       // resting position value
int minima[] = {1023, 1023};  // actual analogRead minima for {x, y}
int maxima[] = {0, 0};        // actual analogRead maxima for {x, y}
int axis[] = {xAxis, yAxis};  // pin numbers for {x, y}
int mouseReading[2];          // final mouse readings for {x, y}

void setup() {
  Mouse.begin(); //Lets me use the mouse functions!

}

void loop() {
  m = accelerometerMotionValue
  value = analogRead(pResistor);

  // read and scale the two axes:
  int xReading = readAxis(0);
  int yReading = readAxis(1);

  // move the mouse:
  if m > 1
    Mouse.move(xReading, yReading, 0); //Move right with tilt right
    delay(responseDelay);

  else if m < -1
  Mouse.move(xReading, yReading, 0); //Move left with tilt left
  delay(responseDelay);

  if (value < 25){
    Mouse.click(button); //click the mouse when the photoresistor is covered
  }
   
}

Five Nights at Freddy's Controller


My controller was designed for the game Five Nights at Freddy's. With this in mind, I didn't make this controller thematic to the series I was more so focused on making the design most efficient for the gameplay and I think this does just that.

First and foremost this controller revolves around using the circuit playground bluefruits accelerometer to move the first person view. By tilting the controller to the left or right it will move the players view towards the left and right doors and leaving the box flat will point the view to the middle of the screen. On top of the box is the PIR motion sensor. Placing your hand above the motion sensor will open and close the door according to whichever direction you are facing. On the side of the box I have the potentiometer which will serve as a light switch for the hallways. This will also depend on whichever direction you are facing to determine which hallway light to turn on. I may move this light to the front of the box for convenience.

Pseudo Code

void setup()

{

Serial.begin(9600);

CircuitPlayground.begin();

}

void loop() 

{

read accelerometer x and y

rotate left = left arrow key

rotate right = right arrow key


Get light sensor reading

if true flip light switch


Get PIR sensor reading

if true flip door switch

}