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 / Animation Not working Help!!

Author
Message
bkbatman
13
Years of Service
User Offline
Joined: 6th Sep 2010
Location:
Posted: 11th Jul 2012 02:05 Edited at: 11th Jul 2012 10:42
Hello the I need help geting a animatedsprite to play inside a Click function?
for Some reason here go a video.

http://www.youtube.com/watch?v=HtrvO5BCrmU&feature=youtu.be



the legendary master
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 11th Jul 2012 19:00 Edited at: 11th Jul 2012 19:01
Well, to begin with you seem to create sprite 5 10 times in the first for loop. That is probably undefined behaviour and thus may or may not cause follow-up issues.
Moreover this for-loop is run for each cycle in the main loop; if it works as intended it will no doubt reset the sprite to its first frame.
Finally any animation carried out on the sprite is nullified because you either forcefully set it to frame 9 if the up key is held down, or frame 1 otherwise.

I hope that helps, although I must admit I'm not entirely sure about what the expected outcome of your snippet is.


"Why do programmers get Halloween and Christmas mixed up?"
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 12th Jul 2012 16:51 Edited at: 12th Jul 2012 16:52
First REMOVE all the loads and creates from your LoopGDK() loop and put them before it. You don't want to load/create images or anything else constantly--it's a drag on the game. It won't actually load/create, but the functions will return as a failed attempt.


Sprites are great, but what you are wanting to do is only show the sprites during certain times. Right? In that case, dbHideSprite() and dbPastSprite() are the commands you need.

EDIT:
This will cause your sprite to only show when you want it to.

The fastest code is the code never written.

Login to post a reply

Server time is: 2024-04-25 10:17:23
Your offset time is: 2024-04-25 10:17:23