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 / Updating sprites, and clock problems[help]

Author
Message
Monckey100
15
Years of Service
User Offline
Joined: 1st Nov 2009
Location:
Posted: 1st Nov 2009 13:51
I hope this was in the right section, i saw Dark GDK and the language is Dark GDK so my assumption was to post here.
Anywho how would i create a proper timer so the animation doesn't jump from point A to point B in an instant?

that would be my code, it seems the stretching sprites reads the sync rate and even with no sync rate it has its own preset timer, however i find myself caught in many situations where i need a proper timer that will affect only if statements and not animations. (i tried Sleep and clock, also the timer, all of them delays the sprites animations to the set clock to it, rendering them useless)

Regards, Monckey100.
Ultimate_H
15
Years of Service
User Offline
Joined: 11th Mar 2009
Location: A place that is neither here nor there
Posted: 1st Nov 2009 21:59
the problem you're having actually has nothing to do with the timers or sync rates. It actually is jumping from one side to the other because you are pausing all action(including updating the screen) while you move the sprite from one position to the other. By using a "while" loop, you are keeping all other action outside of the loop from happening, meaning that the screen is not being updated and causes the sprite to look like it's "jumping" from one side to the other, even though it really is moving smoothly. I would suggest using a different method of moving the sprite(if you are going to have other action) or just add a dbSync() each time you move the sprite.

If I am reading your post right, you are wanting to know how to control movement using timers. If so, I am attaching a source doc you can look at that shows a simple timer based counter going from 1s-5s and resetting each time it reaches that point. If not, then just ignore the download.

Attachments

Login to view attachments
Monckey100
15
Years of Service
User Offline
Joined: 1st Nov 2009
Location:
Posted: 1st Nov 2009 23:28
Quote: "the problem you're having actually has nothing to do with the timers or sync rates. It actually is jumping from one side to the other because you are pausing all action(including updating the screen) while you move the sprite from one position to the other. By using a "while" loop, you are keeping all other action outside of the loop from happening, meaning that the screen is not being updated and causes the sprite to look like it's "jumping" from one side to the other, even though it really is moving smoothly. I would suggest using a different method of moving the sprite(if you are going to have other action) or just add a dbSync() each time you move the sprite.

If I am reading your post right, you are wanting to know how to control movement using timers. If so, I am attaching a source doc you can look at that shows a simple timer based counter going from 1s-5s and resetting each time it reaches that point. If not, then just ignore the download."

I appreciate the help, funny thing is i stuck the sync rate outside of the while statement...
question, how would i conduct this with out a if statement because the function is only called once during a collision of 2 sprites(the mouse and the attack button)[and when called once it just spawns the sprite]

also the timer thing was exactly what i needed

Login to post a reply

Server time is: 2024-11-20 11:28:27
Your offset time is: 2024-11-20 11:28:27