Our controller prototype is made for the online game Fancy Pants. This game was released in 2006, and as a kid I always had a blast playing this game. It is a "free side-scrolling" game that was released on adobe flash, and it stood out to me as a kid due to its unique character movements. Many of the other "free side-scrolling" games that I played on sites like Cool Math had the same smooth and fluid game play that Fancy Pants captured. Initially I designed this controller to be a wheel-like controller that had the Fancy Pants character on the front of the controller, but after reevaluating the effectiveness of this design I drew up a few other concepts and landed on the concept of the Fancy Pants enemy snail as my design inspiration for my controller. In game, the snail attacks the player, but if you jump on the snail it rolls up into its shell and rolls around like a wheel. I wanted to keep the wheel flat due to the 2D design this game holds, and I put the ultrasonic sensor in its mouth so that players will physically jump their hand over the snails weak point, just like the in game character does when attempting to jump on the head of the snail to make it roll up. This physical action that the player makes above the snail increases the engagement the player has with the game as well as strengthens the mapping of the controller design. The movement of the controller left and right signifies to the player both the movement of the in game character, but also the movement that the snail enemy makes in game.
Are there any aspects of the design that you think could be improved to better enhance the connection between the controller and the gameplay experience?
Controller Schematic:
#include <Adafruit_CircuitPlayground.h>#include <Adafruit_Circuit_Playground.h>#include <Keyboard.h>#include <KeyboardLayout.h>#include <Keyboard_da_DK.h>#include <Keyboard_de_DE.h>#include <Keyboard_es_ES.h>#include <Keyboard_fr_FR.h>#include <Keyboard_hu_HU.h>#include <Keyboard_it_IT.h>#include <Keyboard_pt_PT.h>#include <Keyboard_sv_SE.h>#define trigPin A3#define echoPin A2#define led 13bool flag = true;const int debounce = 100;const int threshold = 500;void setup() {CircuitPlayground.begin();pinMode(CPLAY_SLIDESWITCHPIN, INPUT_PULLUP);pinMode(CPLAY_LEFTBUTTON, INPUT_PULLDOWN);pinMode(CPLAY_RIGHTBUTTON, INPUT_PULLDOWN);pinMode(trigPin, OUTPUT);pinMode(echoPin, INPUT);pinMode(led, OUTPUT);pinMode(A1, INPUT_PULLUP);Keyboard.begin();Serial.begin(9600);delay(1000);}void loop() {long duration, distance;digitalWrite(trigPin, LOW);delayMicroseconds(2);digitalWrite(trigPin, HIGH);delayMicroseconds(10);digitalWrite(trigPin, LOW);duration = pulseIn(echoPin, HIGH);distance = (duration / 2) / 29.1;//accelerometer code for x-axis//lets the player control the in-game character by tilting the//controller left and right along the x-axisfloat x = CircuitPlayground.motionX();if (digitalRead(CPLAY_SLIDESWITCHPIN)) {if (x > 2) {Keyboard.press(KEY_LEFT_ARROW); //character moves left when//controller is tilted left//delay(10);} else {Keyboard.release(KEY_LEFT_ARROW);}if (x < -2) {Keyboard.press(KEY_RIGHT_ARROW); //character moves right when//controller is tilted right//delay(10);} else {Keyboard.release(KEY_RIGHT_ARROW);}}//accelerometer code for y-axis//lets the player open doors and crouch using the movement along//the y-axisfloat y = CircuitPlayground.motionY();if (digitalRead(CPLAY_SLIDESWITCHPIN)) {if (y > 2) {Keyboard.press(KEY_DOWN_ARROW); //lets the player crouch//delay(10);} else {Keyboard.release(KEY_DOWN_ARROW);}if (y < -2) {Keyboard.press(KEY_UP_ARROW); //lets the player open doors//delay(10);} else {Keyboard.release(KEY_UP_ARROW);}}//ultrasonic sensor setupif (distance > 5 && distance < 7 && flag == true) {flag = false;}if (distance >= 400 || distance <= 0) { //out of rangeflag = true;}//test functionality with LED 13if (distance <= 4) { // This is where the LED On/Off happensdigitalWrite(led, HIGH);} else {digitalWrite(led, LOW);}//test functionality with serial monitorif (distance >= 400 || distance <= 0) {Serial.println("Out of range");} else {Serial.print(distance);Serial.println(" cm");}//use the ultra sonic sensor to make character jump when player is//within 4 cm of the sensor//fancy pants uses the 's' key to make the character jumpif (distance <= 4) {Keyboard.press('s');} else {Keyboard.release('s');}//use the switch to pause the game//fancy pants uses the 'space' key to pause the gameif (digitalRead(A1) == 0) {Keyboard.press(' ');//delay(100);} else {Keyboard.release(' ');}}
Fancy Pants Controller Demo Video:
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.