This site requires JavaScript, please enable it in your browser!
Greenfoot back
MyHeadHurts
MyHeadHurts wrote ...

2016/3/15

Animation problem

MyHeadHurts MyHeadHurts

2016/3/15

#
Whenever I press the button to start an animation sequence in my program, I have to continue to to hold it for it to play out the entire sequence. What I need it to do is play out the entire sequence once then stop until I press the button again. I have searched everywhere and I cannot find a suitable solution to my problem. Please help me I need to fix this before the week is over.
danpost danpost

2016/3/15

#
You could just introduce a boolean field, call it 'started'. Use it as the condition to continue the animation. Set it to true when the button is pressed and set it to false when the last image of the animation is shown. As an alternative, you could try using my Animation class. It is located in my Support Classes collection.
You need to login to post a reply.