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 Professional Discussion / Timers are unwilling to cooperate :/

Author
Message
SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 4th Mar 2011 04:58 Edited at: 4th Mar 2011 04:59
Ok so I have a fps engine that i'm working on and the way i'v choose to fire the automatic weapons is using timers. But it isn't working :/
yes i have looked at TDK's timer tutorial.

here is the code im basicly usingworking):


here is the code in my gamenot working)



So any ideas guys?

oh btw:
delay is how long it takes for the gun to start fireing
kick is the time that the kickback takes up

My software never has bugs. It just develops random features.
Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 4th Mar 2011 05:15 Edited at: 4th Mar 2011 05:17
at a glance, the compares shouldn't be absolute comparisons, rather they should check for a greater than equal state. So when the time passed is longer than the delay, it's fire time, then when it's longer than delay +kick it'll turn off.

so this,


should be


Dunno if that's your actual problem, but it's a start.


Here's a bit of a re-jig of your first snippet



SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 4th Mar 2011 06:07
Thanks ill try this out

My software never has bugs. It just develops random features.
SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 4th Mar 2011 06:26
It werkz! Thanks a bunch that was a stupid error on my part.

My software never has bugs. It just develops random features.

Login to post a reply

Server time is: 2026-07-16 04:35:49
Your offset time is: 2026-07-16 04:35:49