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.

Newcomers DBPro Corner / animated sprite plays all frames when stoped

Author
Message
sskethan
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Oshawa, ON. Canada
Posted: 6th Dec 2011 20:48
The sprite moves correct and rotates but when i let go of the w key(move forward) the animation continues to play to the last frame before changing to the idle animation. Here is the code i'm using. Is there a way to stop the animation when key is not pressed?
nonZero
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 6th Dec 2011 21:55 Edited at: 7th Dec 2011 07:03
EDIT: Wiped earlier posts, post was getting too long and untidy. Fixed your problem. You may need to modify the code a little for other animations, but this should give you the gist of it.



You can see my edits as I code keywords in caps and use slightly different indents. You should apply this theory to all your animations.

sskethan
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Oshawa, ON. Canada
Posted: 8th Dec 2011 04:38
Sorry i didn't get back right away. This is perfect ... thank you very much
nonZero
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 8th Dec 2011 18:21
You're welcome. Glad it works.

Login to post a reply

Server time is: 2024-11-22 11:41:25
Your offset time is: 2024-11-22 11:41:25