i dont know how to slow down the walking animation of my "Player" character
public void act()
{
if (Greenfoot.isKeyDown("d"))
this.setLocation(this.getX()+7, this.getY());
if (Greenfoot.isKeyDown("d"))
this.animateRunRight();
if (Greenfoot.isKeyDown("a"))
this.setLocation(this.getX()-7, this.getY());
if (Greenfoot.isKeyDown("a"))
this.animateRunLeft();
if (Greenfoot.isKeyDown("w"))
this.setLocation(this.getX(), this.getY()-4);
if (Greenfoot.isKeyDown("w"))
this.animateRunUp();
if (Greenfoot.isKeyDown("s"))
this.setLocation(this.getX(), this.getY()+4);
if (Greenfoot.isKeyDown("s"))
this.animateRunDown();
if (Greenfoot.isKeyDown("right"))
this.setLocation(this.getX()+7, this.getY());
if (Greenfoot.isKeyDown("right"))
this.animateRunRight();
if (Greenfoot.isKeyDown("left"))
this.setLocation(this.getX()-7, this.getY());
if (Greenfoot.isKeyDown("left"))
this.animateRunLeft();
if (Greenfoot.isKeyDown("up"))
this.setLocation(this.getX(), this.getY()-4);
if (Greenfoot.isKeyDown("up"))
this.animateRunUp();
if (Greenfoot.isKeyDown("down"))
this.setLocation(this.getX(), this.getY()+4);
if (Greenfoot.isKeyDown("down"))
this.animateRunDown();
eatPokeball();
}
public void initAnimationSprites()
{
for (int i = 0; i < 4; i++)
{
String filename = "Run" + i + "_90.png";
RunRight[i] = new GreenfootImage(filename);
Greenfoot.delay(2);
}
for (int i = 0; i < 4; i++)
{
String filename = "Run" + i + "_-90.png";
RunLeft[i] = new GreenfootImage(filename);
Greenfoot.delay(2);
}
for (int i = 0; i < 4; i++)
{
String filename = "Run" + i + "_0.png";
RunUp[i] = new GreenfootImage(filename);
Greenfoot.delay(2);
}
for (int i = 0; i < 4; i++)
{
String filename = "Run" + i + "_180.png";
RunDown[i] = new GreenfootImage(filename);
Greenfoot.delay(2);
}
}
public void animateRunRight()
{
setImage(RunRight[animCounter++ % 4]);
}
public void animateRunLeft()
{
setImage(RunLeft[animCounter++ % 4]);
}
public void animateRunUp()
{
setImage(RunUp[animCounter++ % 4]);
}
public void animateRunDown()
{
setImage(RunDown[animCounter++ % 4]);
}

