i am creating a game and i currently have a power up. when the user eats the power up the game increases in speed, it is currently a permanent speed up and i have the code that resets the speed back to normal when it is restarted. however, i want to make it so the speed only increases for 10 seconds rather than for the rest of the current instance.
this is the code for when my character eats the power up:
thanks for any help.
if (canSee(PowerUp.class))
{
eat(PowerUp.class);
Greenfoot.setSpeed(57);
}
