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 / help with timer for my game

Author
Message
xXLoyalWhiteKnightsXx
User Banned
Posted: 28th Mar 2017 16:01
i am trying to make a timer so if you get under 40 seconds you move on to the next level i have used " if f _time# <=50 " but it doesnt work i sm guessing that the timer only works in 50 seconds flat please help
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 28th Mar 2017 17:16
Please read the AUP regarding duplicate accounts. Every account has to go through an approval period, during that time your posts will be hidden and awaiting approval, and will only show up once a moderator has approved them.

How are you updating f_time#?

One method would be to store the timer() variable at the start of the level, then use that to work out the elapsed time...

start_time=timer()
do
cur_time=timer()
elapsed_time=cur_time-start_time
elapsed_seconds#=elapsed_time/1000.0
/do stuff
sync
loop

Then you can use elapsed_seconds# <= 50.0
The code is dark and full of errors
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 28th Mar 2017 23:07

Quote: "Every account has to go through an approval period,"


Well, whoever is approving these isn't paying much attention. This is like his 4th or 5th account now with the same question.
This guy isn't serious about coding... or, if he is, he's 11 years old ( at least mentally) and completely clueless as to how to use a discussion forum!
Send your parents to noisy sprite demo hell... enter the D-Zone

Login to post a reply

Server time is: 2024-03-01 01:49:16
Your offset time is: 2024-03-01 01:49:16