22 October 2023

Scaffolding: Frogger in Progress

 Hello all! I have been working on a schematic for Frogger. The controller for this game is very simple, as is the game it is for. The player moves the frog up and down using the motion sensor in the Circuit Playground Express's gyroscope. The player can also move left and right using a potentiometer posted on the frog's right arm. The idea of the controller is to be shaped like a frog, but to also have an ergonomic feel to it. The slopes between the left leg and arm, along with the right leg and arm, are aimed to make it easier to grab the controller and play the game with it. 


SKETCH:



SCHEMATIC:



PSEUDOCODE:

void setup

{
    Serial.begin(9600);
    CircuitPlayground.begin();
}

void loop
{
    set float y equal to circuitplayground's y motion
    if potentiometer is less than 1/3 of potentiometer values
    {
        press left key
        delay 1000 ms(?)
    }

    if potentiometer is greater than 2/3 of potentiometer values
    {
        press right key

        delay 1000 ms(?)
    }
    if y is less than a certain negative value
    {
        press the down key
        delay 1000 ms(?)
    }

    if y is greater than a certain positive value
    {
        press the up key
        delay 1000 ms(?)
    }
}


No comments:

Post a Comment

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