26 November 2024


Finals Team 13


Camilo Miranda

Daniel Diaz-Rivera


Our project is a toy ship controller designed specifically for bullet hell games, with a particular focus on the game Bullet Hell Monday. The concept originated from the nostalgic joy of a child playing with toy planes and spaceships, enhanced by creating a controller that offers more tangible and interactive feedback. The design integrates the controller's functions with the ship's features in the game for a more immersive experience.

The X-axis control is tilting the controller left and right, simulating the ship's lateral movement in the game. Y-axis movement is controlled with a top-mounted potentiometer positioned where the engines of the toy ship are, giving the sensation of controlling its thrust. Meanwhile, the firing mechanism is mapped to a button located under the "pilot hatch." Pressing this button to "close" the hatch activates the ship's weapons, reinforcing the idea that you're piloting an actual spaceship.

This straightforward approach to controls is designed to enhance the experience, offering a unique alternative to traditional gamepads. Bullet hell games rely heavily on players achieving a flow state, where their movements become instinctive and fully aligned with the game's pace. By creating a controller that lowers the mental barrier to engagement, we aim to make it easier for players to immerse themselves in the game world.

Will this make the game easier? No, not at all, most likely the added physical engagement will increase the challenge as players adapt to the unconventional controls. But we believe that this added difficulty is part of the fun, the same way we suffer through a Dark Souls game.

What other games do you think this controller would be beneficial for? Outside of the bullet hell genre


















Schematic:









Overview Video:


https://youtu.be/HzZsbxppZxA



Code:
//camiloMiranda
#include <Adafruit_CircuitPlayground.h>
#include <Keyboard.h>
const int debounce = 100;
const int threshold = 50;
const int buttonPin = A1;
//int pilot = 2;
bool shoot = true;
int accelX;


void setup() {
  CircuitPlayground.begin();
  pinMode(CPLAY_SLIDESWITCHPIN, INPUT_PULLUP);
  pinMode(CPLAY_LEFTBUTTON, INPUT_PULLDOWN);
  pinMode(CPLAY_RIGHTBUTTON, INPUT_PULLDOWN);
  pinMode(buttonPin, INPUT_PULLUP);
 
  Keyboard.begin();
  Serial.begin(9600);
  delay(1000);
}


void loop() {
    // Toggles shooting functionality on button press
 if(!digitalRead(buttonPin) && !shoot){
    shoot = true;
    delay(debounce);
  }
  if(!digitalRead(buttonPin) && shoot){
    shoot = false;
    delay(debounce);
  }
  if(shoot){
    Keyboard.write('z');
    Keyboard.releaseAll();
    delay(debounce);
  }
 
  // Get accelerometer X-axis for left/right movement
  accelX = CircuitPlayground.motionX();
 
  if (accelX > 3) {  // Move right if accelX > 2
      Keyboard.releaseAll();
      Keyboard.press(KEY_RIGHT_ARROW);
      delay(debounce);
  } else if (accelX < -3) { // Move left if accelX < -2
      Keyboard.releaseAll();
      Keyboard.press(KEY_LEFT_ARROW);
      delay(debounce);
  }


  // Check the potentiometer for up/down movement when slide switch is active
  if(digitalRead(CPLAY_SLIDESWITCHPIN)) {  // Safety switch active
    int potValue = analogRead(A3);
   
    if (potValue > 575) { // Move up
      Keyboard.releaseAll();
      Keyboard.press(KEY_UP_ARROW);
     
      delay(debounce);
    } else if (potValue < 490) { // Move down
      Keyboard.releaseAll();
      Keyboard.press(KEY_DOWN_ARROW);
     
      delay(debounce);
    }
  }
 } 

  



No comments:

Post a Comment

Note: Only a member of this blog may post a comment.