basically,
I have this code for my chars attacks.
now the problem is, that I cant get him being "Image3_right.png" at the end again.
I mean. the moment he stops attacking, his Image should go to "Image3_right.png" again.
I tried it with :
if(!Greenfoot.isKeyDown("Y")
{
setImage("Image3_right.png");
}
but u can see yourself why that wouldnt work :DD
/**
*
*/
public void shoot()
{
if(counter1 == 0)
{
if(Greenfoot.isKeyDown("Y"))
{
getWorld().addObject(new Shot(), getX(), getY());;
setImage("Image3_right.png");
timer(1);
}
}
counter1++;
if(counter1>20)
{
counter1 = 0;
}
}
int i=0;
public void timer(int time)
{
i++;
if(i==time)
{
setImage("Image3_shoot_right.png");
}
if(i==time+1)
{
i=0;
}
}

