Hello there, my problem is, that I want to have a working actor sprite that changes after 3 seconds. Pictures are already drawn and loaded but it just doesnt want to change them.can someone please tell my what im doing wrong and fix it please?
public class Player extends Actor { MouseInfo mouse = Greenfoot.getMouseInfo(); boolean DashIsReady=true; long lastAdded = System.currentTimeMillis(); long DashTimer = System.currentTimeMillis(); int Framestage=1; int Timer1=0; public void act() { if (Greenfoot.isKeyDown("W")) { setLocation(getX(),getY()-5); Timer1=Timer1-1; if(Timer1<=0) { if(Framestage==1) { setImage("PlayerUpFrame1.png"); Framestage=2; Timer1=3; } if(Framestage==2) { setImage("PlayerUpFrame2.png"); Framestage=3; Timer1=3; } if(Framestage==3) { setImage("PlayerUpFrame3.png"); Framestage=4; Timer1=3; } if(Framestage==4) { setImage("PlayerUpFrame4.png"); Framestage=1; Timer1=3; } } }