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.

Newcomers DBPro Corner / Counterdown detection : Help please !

Author
Message
pxidr
18
Years of Service
User Offline
Joined: 10th Jul 2006
Location:
Posted: 11th Jul 2006 00:27
Hi everybody,

On the web site of Dark Basic Pro I recovered a code for make a countdown:

` This code was downloaded from The Game Creators
` It is reproduced here with full permission
` http://www.thegamecreators.com

sync on
sync rate 0
set display mode 1280,960,32
ElapsedTime = timer()
CountdownTime = ElapsedTime + 75000

set text size 80
set text font "Trebuchet MS"

do
cls
print GameTime(CountdownTime)

sync
loop

function GameTime(BaseTime as integer)
local TimeValue as integer
local TextTime as string

TimeValue=abs( timer() - BaseTime )

` Hundredths
TimeValue = TimeValue / 1
TextTime=PadNumber( TimeValue mod 1000 , 3)

` Seconds
TimeValue = TimeValue / 1000

TextTime=PadNumber( TimeValue mod 60, 2) + ":" + TextTime

` Minutes
TimeValue = TimeValue / 60
TextTime=PadNumber( TimeValue mod 60, 2) + ":" + TextTime

endfunction TextTime

function PadNumber(n as integer, Size as integer)
local PaddedNumber as string

PaddedNumber=str$(n)
while len(PaddedNumber) < Size
PaddedNumber = "0" + PaddedNumber
endwhile
endfunction PaddedNumber

I'm a beginner, so...I would like that DBP detects (with certain commands) when the countdown arrives at a certain period (00: 10 for example) to start an event (anything).

Thank you

I'm a beginner, so...
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 11th Jul 2006 00:40
please don't double post the same questions in multiple forums, the one from pro discussion was deleted, this one is ok.

Science, Mathematics, and Physics do not lie - only people do.
pxidr
18
Years of Service
User Offline
Joined: 10th Jul 2006
Location:
Posted: 11th Jul 2006 14:08
Ok. Now, please help me!

I'm a beginner, so...

Login to post a reply

Server time is: 2024-11-26 16:41:43
Your offset time is: 2024-11-26 16:41:43