So I'm trying to animate an actor so that there is a walk cycle animation. I haven't yet tried to add if statements for when the animation should happen, but I am trying to figure out how to have a conintuous animation run when the play button is hit. So far I have
The first three images play out nicely, but they don't repeat and stop once the third and final image is played. Thanks.
1 2 3 4 5 6 7 8 9 10 | public void switchImage() { int span = 2 ; // cycles between image changes imageTimer++; if (imageTimer == span) setImage(image2); if (imageTimer == 2 *span) setImage(image3); } |