18 April 2021

Superflight Controller


My controller is for the game Superflight a game with procedurally generated maps, simple controls, and relaxing. My controller is based around the real-life sport of Hang gliding, the game is based around a wingsuit, close to a glider. The controller has a long white bar with two gloves attached to each side, in the middle of the bar is a box and a Circuit Playground Express is attached to the bar in the box. The idea of the controller was to Improve immersion within the game. The game has 4 controls: A, S, W, D. I also added a capacitive sensor as a space bar to navigate the menu, I used a white wire for this.  The controls for the game all use the Circuit Playground Express to go forward, back, and side to side. X is mapped to right and left and y is mapped to forward and backward. After making and implementing this controller I found that the game lost one aspect and gained another, the game became way less Zen and way more intense. Before having to only use three fingers, using your whole upper body is a drastic change in how you play the game. 

In what could I change the box that holds the CPE to improve the experience for the user? 


#include <Keyboard.h>

#include <Adafruit_CircuitPlayground.h>

#include <Adafruit_Circuit_Playground.h>

#include <math.h>

 

const int debounce = 30;

const int threshold = 500;

 

void setup() {

  // put your setup code here, to run once:

  Serial.begin(9200);

  while(!Serial);

  CircuitPlayground.begin();

  Keyboard.begin();

}

 

void loop() {

  // put your main code here, to run repeatedly:

  //read accelerometer x and y

  float x = CircuitPlayground.motionX();

  float y = CircuitPlayground.motionY();

//go right

if(x < -3) {

Keyboard.write('D');

delay(debounce);

}

//go left

if(x > 3) {

Keyboard.write('A');

delay(debounce);

}

//go foward

if(y < -3) {

Keyboard.write('W');

delay(debounce);

}

//go back

if(y > 3) {

Keyboard.write('S');

delay(debounce);

}

 

if(CircuitPlayground.readCap(A1) > threshold ) {

Keyboard.write(' ');

delay(debounce);

}

}







 

No comments:

Post a Comment

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