Ok So I have this method that's supposed to create a walking animation.
I think the problem is that the image is being shown too fast to be visible. How do I delay the switch times?
P.S, Count is a private class variable that is set to 50
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | public void animate() { if (animState.equals( "idle" )) { setImage( idle ); } else if (animState.equals( "walk" ) ) { setImage( leftWalk ); count--; if ( count == 0 ) { setImage( rightWalk ); count = 5 ; } } |