31 October 2023

Prototype Review - Super Mario

For my controller prototype, I went for a low fidelity cardboard box so I could actually test out the controllers functionality. The box is designed off of the Mystery Boxes within the game, obviously just made of cardboard and therefore brown rather then yellow. It uses the built in accelerometer for movement inputs, using the X-axis for left and right and the Y-axis for jumping and crouching. The controller also uses an external light sensor, which is allows the player to use the fire flower powerup. While the controller is very visually simplistic right now, does it give the idea of it being specially Mario and not just a brown box? If there were any ways you would improve it, what would you do?




Two Notes: 1) I know its a small mess of wires, but it's functional. 2) I stated it in the video, but the controls are a bit sensitive and don't always fully work as intended, I want to adjust them.

Pan's Flute - Prototype Review



The Pan’s Flute controller uses the notes made by blowing through the pipes on the controller to control directional movement in the rhythm rogue like game Crypt of the Necrodancer. Given the high fantasy nature of the game, I decided to go with a pan flute design as opposed to a western concert flute, so as to push the theming parallels between the controller and the game itself. Right now, this controller only uses one pipe and therefore can only move in one direction, as I was figuring out how to set up the piezo sensor via code and circuit. It’s still somewhat sensitive, but after I tweak this some more and add more pipes to my controller, it should work seamlessly.

QUESTIONS:

1)    Should there be sound output when a player “plays” a note into the pipe?

2)    How can I improve on the comfortability of a player using this controller?

 


Prototype Review

This is my controller design for the simple flash game "Tennis Masters". I chose to make a controller for this game because it is a free game that anyone can play online. I think this controller matches the theme of the game not just aesthetically, but functionally. Using this controller makes the game more physical. It also requires more coordination, which makes perfect sense for a sports game. Physically, the controller consists of a battery connected to the Circuit Playground Bluefruit. Near the top of the handle is a potentiometer attached to the CPB. 

What would be the best way for me to cover up the electronics?

How could I improve this design?

What would be a good way to implement a jumping action for the game?


23 October 2023

Scaffolding: Progress Review

For my game controller, I am going with a controller for the game "Nidhogg." This is a fencing game with five basic controls. Moving left/right, raising your sword stance up/down, and thrusting. This will make use of a potentiometer to measure angles and will be designed to be shaped like a sword. I currently don't have the schematic, as I need assistance with working out the math, but the sketch and pseudocode are below.


Sketch



Skematic

Pseudocode


Variables:

lightDetection, lightOnValue, tiltDirection, tiltAmount, twistDirection, controllerHeight, raiseAmount, lowerAmount, keyboardInputs  

         

          If lightDetection is greater than or equal to lightOnValue, enable all other controls

If tiltDirection is forwards and tiltAmount is greater than or equal to required amount, use attack key

If twistDirection is to the left, move the player to the left with proper keyboardInputs

If twistDirection is to the right, move the player to the right with proper keyboardInputs

If  controllerHeight is greater than or equal to raiseAmount, rasie the player's tance

If controllerHeight is less than or equal to lowerAmount, lower the player's stance


 

 

 

Scaffolding: Progress Review

Pac-Man Controller


 











This controller was specifically designed for Pac-Man using light sensors to create a controller that you don't even need to touch to play. To keep the theme of Pac-Man going strong I created the controller to be in the shape of Pac-Man with ghost on it. This design was actually separate from a previous one where I was using an accelerometer. I enjoyed the design so much that I wanted to use this for my final model. For this controller to work all that needs to happen is that you must cover the light sensor with the corresponding direction meaning to move Pac-Man up, down, left and right is that you simply just have to cover the corresponding light sensor.


Void Setup () {

CircuitPlayground.begin();
Serial.begin(9600);
delay(1000);

}

Void Loop () {

Read the sensors for moving pacman
If light sensor 1 is covered move up
If light sensor 2 is covered move down
If light sensor 3 is covered mover right
If light sensor 4 is covered move right

Get light reading
If light is gone/true press key
}

Scaffolding: Project Review - Ender Lilies Flower Brush + Umbral Knight's Sword

 The Flower Brush controller uses two main components, the actual flower brush itself, and the knight sword. The controller works by using many proximity/motion sensors (cost determining), to substitute the inputs of a standard controller/keyboard. Ideally the flowers would light up as the input is read, though material costs might prohibit this. The sword is where horizontal movement and up and down inputs are handled. The sword itself is a 2 way switch, with the player needing to push it up or down in order to control up/down inputs. The handle for the sword is a potentiometer, turning it one way or the other will act as left/right inputs, with variable speeds based on how far it is set. 

The Circuit Playground is housed within a base that connects to the flowers and the sword, it would be encased entirely in the case. The flowers of the bush, if cost enabled would glow white normally, until "activated" where they would glow red for as long as the input was being held/used. If costs didn't allow for this they would be red all the time. 

The actual functionality still needs a bit of work, though if 10 different sensors are too much for the CPE, I could cut back to 8 if I cut out the start and select buttons, and I can cut it further to 2 or 3 proximity sensors that would require certain distances for each input.

Pseudo Code Below:

#Include Libraries

Setup any potential global variables


{

    Setup Code

}


{

    //The following code should be repeated //each time a different input is desired

    //so 8 times, even using the culled flowers, the code will stay as is, and should work


    If( Proximity sensor reading <= certain range)

    {

        Push down 'X' key 

        //'X' is a placeholder for each individual key

        (Delay)

    }


    else

    Push off 'X'


    //Next is the code for the movement inputs, which use the Sword and Sword handle as         switches/potentiometers to control input/movement of the character The game allows for     variable speed when going left and right, so I will try to include that with the potentiometer


    //Potentiometer/left+right first


    if(Analog read resist >= X)

    {

        //Nested statement for increased speed control on movement

        if(Analog read resist >= Y)

        {

            Left/right heavy input

        }


        else

        Left/right light input

    }


    //The code above is repeated and inverted for opposite input


    else

    no Left/right input


    //Next is the switch or the up down input


    if(Switch position == 1)

    {

        input up

    }


    if(Switch position == 2)

    {

        input down

    }

}



 


 

Scaffolding: Progress Review

    My controller design is for the browser game Poptropica. Its main components are a play base with distance lasers, and a harness connected to that base by a bungee cord and a long micro-usb cable. In order to control player movement in the game, the player runs back and forth in front and behind the stand, while wearing the harness. This movement is mapped to the x plane movement of the mouse. The further the player is from the play stand (measured by the distance laser), the further their cursor will be from the center of the screen. This distance is what controls movement speed and direction in Poptropica. In order to actually begin moving in the indicated direction the player will need to jog in place, which will be detected by measuring small changes in the z accelerometer value. This action is mapped to the left click and will result in the player character beginning to move in the indicated direction. When the player jumps, the Y value of the mouse will change and the left click will be triggered, which will translate to an in-game jump (jump detection is achieved using extreme changes in the z accelerometer). By directly mapping the real life movement of the player to the in-game character’s actions it should feel as if the player character is directly copying the player’s movement.

    The purpose of the bungee cord is to allow the player to look sideways while walking, and not accidentally walk out of range of the device. Since the player and player character share the same orientation, the player will have to look sideways as they play, so the cord provides safety by preventing them from moving too far forward and walking into someone or something. In order to prevent the device from simply being dragged along with the player, the large cylinders on the sides of the base will contain bottles filled with sand, providing added weight.





PseudoCode

//include Adafruit and Mouse.h libraries

//create variable for low accelerometer z value to trigger walking
//create variable for high accelerometer z value to trigger jump
//create variable for jump height (y increase for jump trigger)

//configure mouse sensitivity and speed for x axis
//configure mouse sensitivity and speed for y axis

void setup() {
  //Initialize libraries
  //set up slide pin
  //set up IR distance laser #1 (forward facing)
  //set up IR distance laser #2 (rear facing)
}

void loop() {
  //Killswitch conditional -  this conditional reads the slidepin and
  //only executes if flipped; all other logic is nested within as a failsafe
    //if accelerometer z is greater than walking trigger value
      //activate left click
      //delay 100ms for debounce
    //else
      //release left click

    //if accelerometer z is greater than jumping trigger value
      //increase mouse y value by jump height variable value
      //delay 500 ms - this delay provides some in-game air hang time
      //reduce mouse y value by jump height variable value
      //delay 500 ms - extra delay to debounce input (assumes player
      //will reach apex of their real life jump within one second)

    //if IR laser #1 distance is increasing
      //increase mouse x value proportionally
      //short delay to debounce input
    //else if IR laser #1 distance is decreasing
      //decrease mouse x value proportionally    
      //short delay to debounce input

    //if IR laser #2 distance is increasing
      //decrease mouse x value proportionally
      //short delay to debounce input
    //else if IR laser distance #2 is decreasing
      //increase mouse x value proportionally
      //short delay to debounce input
}

Scaffolding: Progress Review

 For my controller, I decided to go with one of my first ideas which was using a pair of scooter handlebars to rotate a sensor and control the player in the game Paperboy for the NES. I liked this idea and decided to pursue it because the design of the controller emulates the gameplay of Paperboy, which involves the main character riding down the street and delivering newspapers to certain houses. The main way this controller will function involves the rotation of the handlebars as well as the bell attached to the top of the handles. An Adafruit gyrometer will be attached to the stem of the handlebars and will rotate as the player turns left and right, thus sending rotational information to the Circuit Playground which will control the player in-game. The bell will be rung and activate the sound sensor on the Circuit Playground, which will then cause the player to throw a newspaper.


Controller Sketch

Controller Schematic



Pseudo Code




Scaffolding: Progress Review LIMBO - "Maggot Eater" Controller

 The "Maggot Eater" controller for my chosen game, Limbo, uses the maggot eaters NPC within the game as the foundation for its design. The three heads allow the user to interact with the game in different ways. Rotating the leftmost head will control the functions attached to the up and down arrow keys using a potentiometer. Closing its jaws modifies the values of the photoresistor embedded in the mouth and allows the player to interact with objects. Rotating the rightmost head will control the functions attached to the left and right arrow keys. Lastly, making noise into the mouth of the middle head will allow the player to jump and uses a sound sensor.

Sketch



Schematic


Pseudo Code 

// include relevant libraries up here


// boolean for if player was pressing left ctrl before (wasControlling)

void setup() {
  // put your setup code here, to run once:

  // set analog pin A1 to an input (right potentiometer)
  // set analog pin A4 to an input (sound sensor)
  // set analog pin A5 to an input (photoresistor)
  // set analog pin A6 to an input (left potentiometer)
  // begin Circuit Playground
  // begin Serial for debug

}

void loop() {
  // put your main code here, to run repeatedly:

  // map input values from right potentiometer to a range of -2 to 2
  // map input values from left potentiometer to a range of -2 to 2

  // read value from right potentiometer
  // if value is equal to 0, "relase" both left and right arrow keys and return
  // if value is greater than 0, "release" left arrow key and "press" the right arrow key
  // if value is less than 0, "release" right arrow key and "press" the left arrow key

  // read value from left potentiometer
  // if value is equal to 0, "release" the up and down arrow keys and return
  // if value is greater than 0, "release" the down arrow key and "press" the up arrow key
  // if value is less than 0, "release" the up arrow key and "press" the down arrow key

  // read value from photoresistor
  // if value is less than default reading, "press" the left ctrl key
  // if value is roughly default reading, "release" the left ctrl key if it was pressed before

  // read value from sound sensor
  // if value is greater than default reading, "write to" the up arrow key

  // if both sound sensor is greater than default reading and photoresistor is less than default reading,
  // "write to" the escape key
  
}

22 October 2023

Scaffolding: Progress Review - Space Invaders Extreme

The controller I'm creating is for the game Space Invaders Extreme. This controller resembles a spaceship because I wanted the players to feel like they are actually controlling the spaceship that is currently in front of them while they are playing the game. You can open up the cockpit of the controller and press the button on the CPE to turn it on and then close it to simulate you are getting “inside” the spaceship and it also activates the controller. Next, because you need to move around the menus and while fighting you can tilt the controller in order to use the arrow key inputs. This also simulates that the spaceship you are controlling is in "combat" and flying. The potentiometer may be turned either way for the player to store the power-ups that they get in the game. Finally, the light sensor is used for shooting in the game and it's supposed to look like a "cannon/gun" that spaceships have. When you uncover the light sensor you shoot in-game, uncover and cover the sensor to shoot fluidly. The resting position of your hands are supposed different but familiar compared to when you hold a normal controller.


Controller Sketch:




Schematic:



Pseudocode:



Pong

 Griffin Shields

The goal of my piece is less to make an easy to use, handy controller perfect for Pong, and more to have thematic fun playing Pong with the controls of the classic Table/Beer Pong. Throwing a ping pong ball (with a bounce, as per usual Beer Pong rules) into one of the two Red Solo Cups successfully will activate the button inside with the impact of the ping pong ball. One button/cup combination is labelled "Up Input" and the other is labelled "Down Input", and they correspond to the up and down arrow key inputs, respectively. The balls roll back to the player down a cardboard ramp and out the cutout in each cup, taking inspiration from arcade basketball, and the player is given 4 ping pong balls so their inputs can come quick enough to keep up with the Ai, as this is primarily for single player, but still expandable with another Circuit Playground.













Scaffolding Review: Cuphead Controller

The main point of my controller is that you are using an actual cup/mug to move the character. The cup will have a Circuit Playground inside it that will read the accelerometer x and y which will get the character to move, jump, and crouch. The Adafruit will also read the sound and light sensor to trigger various actions that the player will use to defeat the various bosses. By tilting the cup/adafruit circuit left and right, the character can move left and right. The player can jump and crouch when it tilts up or down. I also want my controller to have a single button that the player will hold down for the character to fire out projectiles. The sound sensor will cause the character to unleash a special attack. To trigger it, the player may have to scream into the cup.





Pseudo Code

void setup()

{

Serial.begin(9600);

CircuitPlayground.begin();

}


void loop() 

{

read accelerometer x and y

tilt left = left arrow key

tilt right = right arrow key

        tilt up = up arrow key

        tilt down = down arrow key


        If button is pressed

        character will shoot


Get sound sensor reading

        if sound is > 90

        character will ex shoot (strong attack)


        get light sensor reading

        if light is < 90

        character will dash


}

Scaffolding: Progress Review

 For my controller I chose to make the control helmet found inside the game, Inside, in the game you use this helmet to control others and move them around by having the main character attach the helmet onto himself, so to control the game I am making the helmet as a controller for the game to immerse the player in the deep and enthralling atmosphere and narrative of the game. The controls for the game are simple you use the motion of your head to control whether the character goes left, right, jumps, or dives, by using an accelerometer PE attached to the front of the helmet, You can use the z-axis and y-axis motions to control the movement of the character. In addition, you can grab items by blocking the light sensor on the Circuit Playground like blocking the lights in the game, to use the ctrl key. You may also use the switch to open the menu, or escape key. The helmet also has external LEDs that light up certain colors for a more immersive experience and to keep the light sensor consistent.


Controller Sketch:

Schematic:



Pseudo Code:








Scaffolding: Progress Review - Sonic Spinball Pinball Machine Controller

       For my unconventional game controller, I have chosen to make a miniature, handheld pinball machine controller for the game Sonic Spinball. As the game is a pinball game, I figured it would be cool to be able to control it with a pinball table, making players feel as though they were playing the game on an actual pinball machine. Conceptually the controller will function like an actual pinball machine would; there will be a switch on either side that flipping will control the flippers in game, a plunger at the bottom that when pulled and released will launch a ball that covers the Circuit Playground Express' built-in light sensor and will cause Sonic to jump in-game as well as toggle both flippers, and finally two light sensors within the machine that can be covered with a ball by tilting the controller left or right to cause Sonic to move left or right in-game as though the player was tilting the pinball machine in order to cheat and move the pinball in a more desirable direction.



                                                              Controller design sketch


                                                        Schematic of controller circuit

// Code written by Kyle Amburgey, 2023

 

#include <Adafruit_CircuitPlayground.h>

#include <Adafruit_Circuit_Playground.h>

#include <Keyboard.h>

#include <KeyboardLayout.h>

// #include external lightsensor library

// #include mini toggle switch library

 

// initiate Circuit Playground light sensor, pin A8

 

// initiate all three external light sensors

const int lightSensorPin1 = A7;

const int lightSensorPin2 = A1;

const int lightSensorPin3 = A0;

// initiate both mini toggle switches

 

void setup() {

  //Opens CPE serial port

  Serial.begin(9600);

  // 1 second delay

  delay(1000);

  // Starts CPE

  CircuitPlayground.begin();

  // Allows keyboard controls

  Keyboard.begin();

  // Set Circuit Playground light sensor as input

 

  // Set all three external light sensors as inputs

 

  // Set both mini toggle switches as inputs

 

}

 

void loop() {

  // If light sensor 1 is covered, then press and hold "left arrow key"

 

  // If light sensor 2 is covered, then press and hold "right arrow key"

 

  */ If light sensor 3 is covered, then press and hold "C" (both flippers / jump), then delay for 1 second/*

 

  // If toggle switch 1 is switched on, then press and hold "Z" (left flipper control / jump)

 

  // If toggle switch 2 is switched on, then press and hold "X" (right flipper control / jump)

 

}

                                                        Pseudo code for controller


Scaffolding: Progress Review - The Bite of '87?!

Hello? Hello, hello? I thought I'd leave this blog post here to get you settled in for this scaffolding, specifically my alternative controller for Five Nights at Freddy's 1. When we last met, I was quite unsure of how I wanted to take you on this journey to Hurricane, Utah. Now, however, I've got a solid idea, and what better way to experience the terror of FNAF 1 than with a custom-made office controller?

Meant to mimic the office the player character works in, this one is a bit more bare-bones - and way, way smaller. Meant to be held somewhat like a controller, your thumbs are meant to hover near the touch sensors, so you can quickly close the doors if an animatronic is approaching. Of course, how would you tell without the lights? Cover the light sensors on top of the walls to illuminate the doorways in-game. The LEDs on the floor will tell you whether your doors and lights are on at a glance - and the three-way toggle switch will help you literally glance at either door, or back to the center of the office. If you need to check the cameras, never fear!...or do, since the cameras are activated (and deactivated) by a burst of noise, notably yelling. The handy potentiometer in your desk is used to cycle between the different cameras. 

Schematic: WIP

What's the driving force behind your new controller? Take a look! 

 Start function: assigning input variables to external sensors/switches, as well as output variables for the LEDs. 

Loop function: check for inputs. If sound sensor is triggered, open or close cameras and activate the potentiometer in checkCams. If light or touch sensors are triggered, send the respective input to the game, and to the changeLightLED or changeDoorLED function (with the index of the left or right LED. These last two functions may just be integrated into Loop & driven by booleans, tbh). If the switch is toggled, turn the camera to face that direction.

checkCams: ignores light/touch sensors + toggle switch and listens for 1) potentiometer movement and 2) sound input again, in order to close cameras. One prolonged shout will only open the cameras once, you have to get quiet and then yell again to close them.

 changeLightLED: turns on the LED and allows it to flicker somewhat, like the button/lights do in-game.

changeDoorLED: changes the light of the door LED from red to green, or green to red, depending on the previous state of the door.

We hope you enjoy your week at Freddy Fazbear's Pizzeria, and don't forget! It's just a game. A horror game!

Scaffolding: Progress Review

 For this controller, I have decided to make it for the NES Super Mario and the exterior of the controller will be to resemble that of the old school Etch-a-Sketch toy. The controller will use two rotary knobs to go left or right on the X-axis, a light sensor at the bottom of the controller will allow for crouching. A use of the accelerometer in the Circuit Playground Bluefruit will work as a jump feature and the audio sensor will be used for special actions, example being the fireball. The intent is to utilize a familiar game design UI and repurpose the actual device to be used as a digital interface.


Controller Sketch:


Schematic:


Pseudo Code:


Scaffolding: Progress Review (FINAL FANTASY VII Sword Hilt Controller - Joseph Donnelly)

                    Sketch:


                    Description: For my game, Final Fantasy VII, I am using a controller based on a sword hilt, specifically meant to evoke the hilt of the Buster Sword from the game. A player tilts the hilt to move, swings it to attack, and shouts to cancel. This provides a sense of immersion to the game, in ways similar to motion controls that were present in the 8th generation, but with the added element of sound. The shouting is inspired by the concept of the "kiai" which is present in Japanese martial arts, and by extension much of Japanese pulp fiction, where energy is released by shouting, or shouting is used a way to show exertion. Thus, the cancel button is activated by letting out a shout, similar to a kiai one would let out when swinging the sword. 

                    Schematics:





 Pseudocode:   

    //Get x-axis rotation

    //If rotation greater than 3, then Controller Input D-Pad Right

    //Delay 100 milisecond

    //If rotation less than 0, then Controller Input D-Pad Left
    
    //Get accelerometer Y-input

    //If rotation greater than 3, then Controller Input D-Pad Up
    
    //Delay 100 milisecond
    
    //If rotation less than 0, then Controller Input D-pad Down
    
    //Delay 100 milisecond
    
    //Get accelerometer Z-Input
    
    //If rotation greater than 5, then Controller Input Confirm
    
    //Get microphone reading

    //If reading greater than 100, then Controller Input Cancel

 The Huddle Controller

For my controllers design, I am basing it aesthetically off of the final creature you encounter within the world of Play Dead's, "Inside". The creature or better known as "The Huddle" is a very memorable final sequence for all who have played the game and it felt best to honor it within the design of my controller. The way the controller works is that by pulling or tilting the huddle in a specific direction it will move the character on screen accordingly. I will also have "Pressure Plates" on the same board that will actually be light sensors in disguise. When the player puts their hands over the light it will enable the player to either grab an item or jump depending on the light they cover.   

 





Scaffolding Progress Review

 The glove controller I am making mimics gardening gestures for interactive controls for Plants vs Zombies and it just makes a lot of sense since it is an actual tool gardeners use in a game where you are technically planting plants. Tilting the hand scrolls the screen left, right, up and down, bend thumb cycles plants, bend index finger plant selected, and squeezing activates abilities. This makes the gameplay turn into the act of nurturing a garden. Plants vs Zombies is all about fighting off zombies with plants, so planting with a glove on makes perfect sense for the controller and game relationship. Slide potentiometer in the pseudo code is actually meant to be FSR resistor. 







Scaffolding: Frogger in Progress

 Hello all! I have been working on a schematic for Frogger. The controller for this game is very simple, as is the game it is for. The player moves the frog up and down using the motion sensor in the Circuit Playground Express's gyroscope. The player can also move left and right using a potentiometer posted on the frog's right arm. The idea of the controller is to be shaped like a frog, but to also have an ergonomic feel to it. The slopes between the left leg and arm, along with the right leg and arm, are aimed to make it easier to grab the controller and play the game with it. 


SKETCH:



SCHEMATIC:



PSEUDOCODE:

void setup

{
    Serial.begin(9600);
    CircuitPlayground.begin();
}

void loop
{
    set float y equal to circuitplayground's y motion
    if potentiometer is less than 1/3 of potentiometer values
    {
        press left key
        delay 1000 ms(?)
    }

    if potentiometer is greater than 2/3 of potentiometer values
    {
        press right key

        delay 1000 ms(?)
    }
    if y is less than a certain negative value
    {
        press the down key
        delay 1000 ms(?)
    }

    if y is greater than a certain positive value
    {
        press the up key
        delay 1000 ms(?)
    }
}


Scafolding progress

 

Description:   

    The controller is designed to be contained within a box with a bowl inside of it and the bowl assembly itself is covered with a sheet of acrylic. Inside this bowl is a ball. On the sides of the bowl are four contact wires. When the ball touches the wire, it inputs a direction in the game. Therefor tilting the bowl up inputs up and so does left, right, and down. The controller is designed to play Pacman championship edition. The ball itself represents Pacman and tilting the bowl is like leading Packman in that direction. This will make it both simple and intuitive to use for anyone. 

Sketch: 


Schematic:



Pseudo Code:

 

Scaffolding: Progress Review

For this control, I've decided to make it for Super Mario and base the exterior look of it on the Mystery Block in the game. The controller uses the Circuit Playground Express's built in accelerometer to movement along the X-axis to allow the player to move Mario in the level and a slight amount of detecting movement on the Y-axis, likely only in the positive range, to allow the player to crouch. While I would like to use the built in light sensor, an external one might be needed and placed on the top of the box, acting as the way for the player to use the Fire Flower's power when they block light from the sensor. A button will be placed on the bottom of the box to allow the player to jump but is treated in a way to seem similar to how Mario jumps up to hit the bottom of these boxes in game to open them.


Controller Sketch:


Schematic:



Pseudo Code: