a simple 3 minute program

Blitz3D Forums/Blitz3D Beginners Area/a simple 3 minute program

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Ok heres the new code i added comments to make it more readable, and if you look you'll see where i need help.

AppTitle "3minutes"

Graphics 300,100,1,2
SetBuffer BackBuffer()

;some veriables
s=31

t=20

second=0

minute=0

start=False

secondtimer=MilliSecs()

;loads the sound.
sound = LoadSound("Ungodlysound.wav")

While Not KeyHit(1)
Cls

;clock and timer code:
If MilliSecs() > secondtimer+1000 Then
second=second+1
secondtimer=MilliSecs()
End If
If second>59 Then
minute=minute+1
second=0
End If
If minute=3 Then
minute=0
PlaySound sound
second=0
End If

;stop and start switchs
If KeyHit(s) And start=False
start=True
Else If KeyHit(t) And start=True
start=False
End If

;atempt to make the start/stop switch stop and start...
If start=False
; What goes here???
; nothing i'v tried works ...
; Help!
End If

;display the switch status
If start=False
Text 20,60,"Press 'S' to Start the timer."
Else If start=True
Text 20,60,"Press 'T' to Stop the timer."
End If

;some other displays
Text 60,80,"Press ESC to Exit."
Text 130,30,minute+":"+second

;delays the program updating every half a second. slows down the lagg big time
Delay 500

;flips the buffer, ends the loop and when it ends it ends the program.
  Flip
Wend
End


Notice the problem, i got the switch working, it just needs somthing to stop the timer, so basicly, what code stops a timer?

;atempt to make the start/stop switch stop and start...
If start=False
; What goes here???
; nothing i'v tried works ...
; Help!
End If