23 October 2023

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
  
}

No comments:

Post a Comment

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