Hello, I am new to processing and programming in general, as of a project for school I ran into a problem.
The goal is that a random number will be generated, with a click on a the mouse, after that it should go to the specific if statement and do those tasks.
Now the problem is that the random number will be generated, but that only the first if statement does what it is supposed to do, and that is show the rectangle. can you guys help?
class Fish {
int jumpPosition;
int test;
void fishJump() {
if (mousePressed) {
jumpPosition = int(random(4));
println(jumpPosition);
}
if (jumpPosition == 0) {
fill(255);
rect(250, 250, 50, 50);
}
if (jumpPosition == 1);
{
fill(255);
rect(750, 250, 100, 100);
}
if (jumpPosition == 2);
{
fill(255);
rect(250, 750, 100, 100);
}
if (jumpPosition == 3);
{
fill(255);
rect(750, 750, 100, 100);
}
}
}