Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Animate Sprites Without holding a key

Author
Message
chikarazuyoi
15
Years of Service
User Offline
Joined: 12th Sep 2009
Location:
Posted: 3rd Oct 2009 16:44
Okay so i have a sprite sheet with over 200 sprites, on that sheet there is a series of sprites to perform a slash animation, the problem is: i do not know how to perform all those animations when a button is pressed such a 'return'.

Here is a segment of my code:


In the "for loop" i was attempting to play all my sprites related to my slash animation but it seems like the "for loop" is ignored because once i release the 'return' key the animation stops.

Any help would be appreciated.
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 3rd Oct 2009 19:25
I havent tested this, but it gives off the general idea.

chikarazuyoi
15
Years of Service
User Offline
Joined: 12th Sep 2009
Location:
Posted: 3rd Oct 2009 20:38
I sawwhat you were tying to do and modified it but it did nothing, hers my new code:



the only thing this does thos is "dbSetSpriteFrame ( hero, 22 );
" and completely ignored the while loop
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 4th Oct 2009 20:59
What if you try this? (I can't test it without actually creating an animated sprite.)

Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 4th Oct 2009 22:05
Here is a little more developed version. The problem with the previous one is that the program won't do anything else until the animation is finished. It's better to set a flag and check every loop if the animation is still playing.

Does any of these work for you?

Login to post a reply

Server time is: 2024-10-01 14:41:35
Your offset time is: 2024-10-01 14:41:35