Hi, I am creating a game for school and I was wondering if there was a way to change the frequency of image switching. Meaning that the image will switch faster sometimes and faster other times. Thanks for the help!
public static final GreenfootImage boyWalkright1 = new GreenfootImage("boymovingright1.png");public void WalkRight(){
frame++;
switch (frame){
case 1: setImage(boyWalkright1); break;
case 4: setImage(boyWalkright2); break;
case 7: setImage(boyWalkright3); break;
case 9: setImage(boyWalkright4); break;
case 11: frame = 0; break;
}
}