I already tried everything but the animation is still fast as hell. Im new to green foot so I'm not familiar with its codes need replies ASAP :( thank you in advance!
public class Enemy2 extends Actor
{
GreenfootImage ptt1 = new GreenfootImage("ptt1.PNG");
GreenfootImage ptt2 = new GreenfootImage("ptt2.PNG");
GreenfootImage ptt3 = new GreenfootImage("ptt3.PNG");
GreenfootImage ptt4 = new GreenfootImage("ptt4.PNG");
GreenfootImage ptt5 = new GreenfootImage("ptt5.PNG");
public int frame = 1;
public int animationCounter = 0;
/**
* Act - do whatever the Enemy2 wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
animate ();
if(animationCounter % 6 == 0)
{
}
}
public void animate ()
{
if (frame == 1)
{
setImage(ptt1);
frame = 2;
}
else if (frame ==2)
{
setImage(ptt2);
frame = 3;
}
else if (frame == 3)
{
setImage(ptt3);
frame = 4;
}
else if (frame == 4)
{
setImage(ptt4);
frame = 5;
}
else if (frame == 5)
{
setImage(ptt5);
frame = 1;
}
}
}


