28 March 2021

Progress on Game Controller

David Perez


As I stated in my concept page, my controller is being made to control Five Nights at Freddy's 2. The game is controlled almost entirely by the mouse with point and click controls although left Ctrl is used to activate a flashlight. The controller will have a sort of 'plug and play' design to it minus any sort of joystick you'd typically see. There will be a potentiometer/dial and four toggle switches.

Look Control: The potentiometer will control camera look horizontally when inside the security office view and will navigate camera feeds when inside camera view.

Flashlight: One toggle switch will control the flashlight. Normally left Ctrl would be held down to keep it on, the toggle switch will let the player toggle it on and off.

Camera Toggle: One toggle switch will activate the camera feed. Flipping the switch off will return the player to the security room view.

Wind Music Box: One toggle switch will mouse over and begin using the MUSIC BOX option which winds a music box, one of the key mechanics of the game.

Mask Toggle: One toggle switch will put on the Fazbear mask. The code for this should function identically to the camera toggle; the player will remove the mask when toggled off.

Controller Sketch

The controller is intended to have a plug and play design. It's boxy and intended to be placed on a table or on the player's lap as they play.
 

The casing will be an 8in x 8in x 4in wooden box (4in high). The intention is for the player to play with the controller sat either on a table or in their lap. The dial will be directly in front of the player spaced in the middle with the toggle switches placed behind it. The aim of the design is ease of use as well as a friendly design for left handed and ambidextrous players.

 

Is there anything about the placement of the controls that would seem off or bad? Should I be relocate any of the controls? Should I look for any alternatives to the toggle switches I'm using?

Does it seem like it would be comfortable to use this controller on a table or in your lap? Are there any changes I should consider for the comfort such as a different casing?

Pseudo-Code

[inclusion of all necessary libraries]

[initialization of all variables and pins]

  •  Integers for storing conditions
  • Arrays for handling large data sets  
    •  Mouse[2] = (x = 1, y = -1), (x = 4, y = 0);
  • assigning integers to pins

[Void start]

  • CircuitPlayground.begin(); MUST go first to properly run
  • Declare CPE pinModes
  • Mouse.begin();
  • Keyboard.begin();

[Void Loop]

  • Call function to read potentiometer, map to mouse input
    • if (in camera) [enable camera controls]
      • undo previous Mouse.move to reset
      • new Mouse.move(x, y) to apply mouse movement
    • else Mouse.move(x, 0);
  • Toggle Switch code for activating/deactivating flashlight
  • Toggle Switch for activating Camera
    • change potentiometer to move to camera feeds
    • change Toggle Switch for deactivating camera
  • Toggle Switch for equiping/unequiping Mask
Splitting the more complex controls into functions eases the readability of the Loop.
 
[Mouse Function]
  • Variable to get value from analogRead(potentiometer)
  • if (in camera)
    • map variable down to 12 points for the game's 12 camera feeds
  • else
    • map to look left, look right or center
  • Return value to Loop

No comments:

Post a Comment

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