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.

DarkBASIC Discussion / Timer help pelase

Author
Message
Takeshii
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location:
Posted: 4th Oct 2005 20:11 Edited at: 4th Oct 2005 20:28



Ok essentially what im trying to do is swap out the sleep cmd and replace it with a timer. I have not experimented with timers very much and do not know how to implement them into this. Sprites 600 - 615 are an explosion that i want to play through with out pausing the game... If you need more info just ask i dont know exactly what you need

Dark
<I>TDK I Love you...... And yes, you should be scared</I>
nojbox87
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: England
Posted: 4th Oct 2005 21:39
sorry im not great with timers but have u seen TDK's timer tutorial? http://forum.thegamecreators.com/?m=forum_view&t=59347&b=7
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 5th Oct 2005 11:58
you want to update the anim every 20msecs (since thats how long your existing code sleeps) so alter your code so that if the timer is 20msecs on from the last call then you increment l and show the next animation frame, inside the same decision you also check for l being over 615 and if it is then you set l to 600, you might need some extra checks but the basic idea is to just do this when the timers says and reset the timer ready for it trigger at the next frame and update the anim, to end the flame you just hide the sprite and position it off screen somewhere, creating and deleting them in the program causes a slight slowdown.



why do they say Aliens are gonna be friendly?, surely the agressive ones wipe out the peaceloving ones, so all you have left out there are crazed flesh eating interstellar monsters.

Login to post a reply

Server time is: 2025-05-22 17:34:46
Your offset time is: 2025-05-22 17:34:46