23 October 2024

Scaffolding: Progress Review ∙ Happy Wheels Arm Controller

                    Our controller is a wearable sleeve that acts as the mode of control between you and the playing character. The game we chose for this project was none other than a classic, Happy Wheels! The design of our controller relates to the game by having your arm act as the controller for which you control the character’s on-screen movements. This works by measuring the tilt of accelerometer to lean the character forward and backward, it also measures the height of the Z+ axis which translates to the Jump function in the game. You can also propel your character forward and back by interreacting with the Ultrasonic Sensor located near the wrist, by treating it like a “gas pedal”.

                The visual design of our controller relates to the game by having you keep your arm steady to not throw your character off balance when zooming through the level, as the goal of the game is to make it without catastrophically damaging yourself. The design of our unique inputs mimics the game’s functionality in multiple ways. The jump is done by bouncing your arm upwards, the speed acts like a Car’s accelerator (using the Ultrasonic), and leaning your arm leans the character.



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


  // set in and out pins
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);  

  // Initialize
  // trigPin LOW

}

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

  // GET INPUTS

  // send message to distance sensor for 10 milliseconds

  // trigPin HIGH

  // trigPin LOW
  // get echo value from echoPin
  // Convert time of echo into distance (mapping?)

  // get values from the accelerometer

  // INTERPRET INPUTS

  // if (abs(accelY) > threshold)

    // if (accelY is positive)
      // release RIGHT ARROW [TILT RIGHT]
      // press LEFT ARROW [TILT LEFT]

    // if (accelY is negative)
      // release LEFT ARROW [TILT LEFT]
      // press RIGHT ARROW [TILT RIGHT]

  // else

      // release both ARROW keys


  // if (accelZ > threshold)
    // press SPACE [JUMP]

  // else

    // release SPACE [JUMP]

  // if (distance is xtraClose)
    // press Z
    // release both ARROW keys

  // if (distance is close)
    // press UP ARROW [MOVE FORWARD]
    // release Z and DOWN ARROW

  // if (distance is far)
    // press DOWN ARROW [MOVE BACKWARD]
    // release Z and UP ARROW

  // else
    // release both ARROW keys and Z

  delay(debounce);
}

No comments:

Post a Comment

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