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...