I need to change a bouncing balls color from red to blue and blue to red every second.
what I've guessed so far is...
If (something)
{
ball1.Color(Color=RED);
}
else (something)
ball1.Color(Color=BLUE);
could someone help me figure out the code to make it change every second? I know it'll have to do with time... but I just can't figure out what to put within the paratheses.
I've tried a few different things like...
PAUSE1 = 50
if PAUSE1 >= 1000)
{
ball1.setColor(Color.BLUE);
}
else if (ball1.getX( ) 20 * <= 1000)
{
ball1.setColor(Color.GREEN);
}
idk I can't seem to figure out what to put... I'm very new to this.
what I've guessed so far is...
If (something)
{
ball1.Color(Color=RED);
}
else (something)
ball1.Color(Color=BLUE);
could someone help me figure out the code to make it change every second? I know it'll have to do with time... but I just can't figure out what to put within the paratheses.
I've tried a few different things like...
PAUSE1 = 50
if PAUSE1 >= 1000)
{
ball1.setColor(Color.BLUE);
}
else if (ball1.getX( ) 20 * <= 1000)
{
ball1.setColor(Color.GREEN);
}
idk I can't seem to figure out what to put... I'm very new to this.