I am trying to make a game using processing where a cube follows a set path and has to jump over obstacles.
in
Programming Questions
•
2 years ago
So far this is what i have, i just need to find a way to get my object back down after it jumps
float boxy;
void setup()
{
size(400, 400);
boxy = height - 50;
}
void draw()
{
background(120);
if (jumping) {
boxy--;
}
rect(width/2, boxy, 20, 20);
}
boolean jumping = false;
void keyPressed()
{
if (keyCode == 38 && !jumping) {
jumping = true;
}
}
1
