The code below is where the timer goes.
level1:
cls
limit = 100
add = 30
Set Text Opaque
Ink RGB(255,255,255),0
Seconds=30: Rem change this value to alter the length of the timer
T=Timer()
Repeat
Elapsed=(Timer()-T)/1000
TimeLeft=Seconds-Elapsed
Text 0,0,Str$(TimeLeft)+" "
do
paste image 8, 0, 0
gosub displayScore
gosub balloon
if score >= limit then exit
loop
Until TimeLeft=0
gosub level2
return
And these two subs below are run at the same time by balloon sub.
showBalloon:
positionx = rnd(530)
positiony = rnd(401)
balloonNum = rnd(3)+1
sprNum = sprNum + 1
sprite sprNum, positionx, positiony, balloonNum
set sprite 1, 0, 1
if balloonNum = 1 then burst = 11
if balloonNum = 2 then burst = 12
if balloonNum = 3 then burst = 13
if balloonNum = 4 then burst = 14
sync
return
balloonMouseCollision:
do
if mousex()>sprite x(sprNum) and mousex()<sprite x(sprNum) + sprite width(sprNum)
if mousey()>sprite y(sprNum) and mousey()<sprite y(sprNum) + sprite height(sprNum)
if mouseclick()=1 then delete sprite sprNum : score = score + add : play sound 1 : sprite burstNum, positionx, positiony, burst : wait 150 : delete sprite burstNum : exit
endif
endif
loop
return