count down timer not working in Win7
Posted: Tue Dec 21, 2010 4:22 am
I'm currently rebuilding Texas Shoot 'Em to Windows 7 compatibiltiy, but found that the countdown timer doesn't work. Does anyone have a solution for a countdown timer that will work with Windows 7?
The current timer code is from ShadowHunter I believe (shown below).
The good news is: This game uses the new Keyguard features very heavily and it's working flawlessly!
Thanks for any help
The current timer code is from ShadowHunter I believe (shown below).
The good news is: This game uses the new Keyguard features very heavily and it's working flawlessly!
Thanks for any help
- Code: Select all
Sub TimerStart(gTimer)
gTimer = Timer
End Sub
Function TimerElapsed(beginTime)
If beginTime <> 0 Then
TimerElapsed = Timer - beginTime
Else
TimerElapsed = 0
End If
End Function
Sub TimerReset(gTimer)
gTimer = 0
End Sub
Sub UpdateCounter()
'---------------------------------------------------------------------------------------------------------
'This routine deals with the count down timer. It also changes the font color when the time is <20 and <10
'when the counter changes from 2 digit to one digit the position is adjusted to keep it centered. When the
'counter is <10 a new control is loaded to show in big red font the time in the center of the map
'When the time is up the timed event is removed and the game over screen is displayed.
'----------------------------------------------------------------------------------------------------------
If CountDownTimer = 1 Then
RemoveTimedEvent(0)
Text(4).Caption = "0"
Action.GoToFrame("score")
Exit Sub
End If
CountDownTimer = CountDownTimer - 1
If CountDownTimer = 10 Then
PlaySound2 GetPath(4) & "red_tail_hawk.mp3", 3, False
End If
If CountDownTimer < 10 Then
Text(4).ForeColor = RGB(255,0,0)
End If
Text(4).Caption = CountDownTimer
End Sub