So whenever the mouse is clicked on a button,the image changes.But not for long enough,its only for a split second.How would I have the image change for >1 second?
int timer;
public void act()
{
if (timer > 0)
{
timer--;
if (timer == 0) /* change image back */;
}
else if (Greenfoot.mouseClicked(this))
{
play();
setImage("left.png");
timer = 100;
}
}