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 / Timer Using BASIC2D

Author
Message
ArcherSam
15
Years of Service
User Offline
Joined: 13th Mar 2011
Location: Florida, US
Posted: 27th Apr 2011 06:48 Edited at: 27th Apr 2011 06:54
I need help building a basic timer that progresses over four minutes. Also I need the timer to show progress without stopping runtime(or without using the WAIT command)!



Sam
enderleit
19
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 27th Apr 2011 12:24
I made some castbars using timers a long time ago... could probably be used for that...

http://forum.thegamecreators.com/?m=forum_view&t=146651&b=5

ArcherSam
15
Years of Service
User Offline
Joined: 13th Mar 2011
Location: Florida, US
Posted: 27th Apr 2011 15:21
Thanks enderleit. Amazing and simple timers!
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 27th Apr 2011 15:43
Try something a little simpler using the "timer" command like this:


ArcherSam
15
Years of Service
User Offline
Joined: 13th Mar 2011
Location: Florida, US
Posted: 27th Apr 2011 15:59
Thanks baxslash. Before posting this issue, I had tried using timer and failed. The conversion done in get_time(ms) are really helpful and allowed me to see how to use TIMER().
ArcherSam
15
Years of Service
User Offline
Joined: 13th Mar 2011
Location: Florida, US
Posted: 27th Apr 2011 16:54 Edited at: 27th Apr 2011 16:55
With the solution provided by baxslash I was able to achieve my goal. Also the reason I have to use function, and subroutines in this format is because of the game structure of my game. When I have issues, I extract the necessary coding to solve the issue and then I make sure it is the follows the game structure in order for easy application of the solution.

baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 27th Apr 2011 17:04
Great! Glad to help

You could also optimise my function a little by removing the "hrs" part since you aren't using it.

Login to post a reply

Server time is: 2026-07-11 12:20:49
Your offset time is: 2026-07-11 12:20:49