How to stop an animation?

johnjanowskibsc

  • Posts: 82
Hi,

I've created a power bar that goes up and down. The mechanics of my game work by pressing the mouse button a ball is fired in the direction of a rotating arrow. I've got so far that when I press the mouse the arrow stops moving, however when I press the mouse again the power bar keeps going up and down! I've tried all kinds of jiggery pokery but it just isn't playing ball. I have attached the code blocks for the test level and the code for the power bar plus the current state of the game so you can see more clearly what is occurring!

http://www.stencyl.com/game/play/40246

Or is there another way of stopping an animation?
Any help would be greatly appreciated as always! John


JeffreyDriver

  • Posts: 2084
I think it's because your custom go event is set to run every 0.1 seconds so they'll continue to do that.

Instead, at the end put a do after  0.1 event that checks if the event should be triggered again or not.

Have you not thought about using a drawn object instead of an actor?
Current Projects:
The Grand Grimoire Chronicles Episode 1 now on Kongregate!.
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk

johnjanowskibsc

  • Posts: 82
Thanks Jeffrey - yes you were right.

I took out the do every 0.1 second and at the end of the block I triggered the event again. Code is attached if you are interested!

Thanks

John