home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Magazine 28 Bonus
/
CDRomMagazine-SoftKey-ArtPassion-FrenchVersion-Win31Mac.bin
/
data
/
pvtecpl.dir
/
00095_Script_TimerScript
< prev
next >
Wrap
Text File
|
1996-06-16
|
1KB
|
70 lines
on setTimer
timeOutOff
global allotedSeconds
put 60 into allotedSeconds
global gameStartTicks
put the ticks into gameStartTicks
set the text of cast "GameTimer" to string(allotedSeconds)
end
on timeElapsed
global gameStartTicks, allotedSeconds, gameOver
put allotedSeconds - ((the ticks - gameStartTicks) / 60) into gameSecondsRemain
set the text of cast "GameTimer" to string(gameSecondsRemain)
put false into gameOver
if gameSecondsRemain <= 0 then
set gameOver = TRUE
gameOutOfTime
return TRUE
end if
end
on gameOutOfTime
endGeoGame -- switch off 'when mousedown then' stuff
playGameOver
end gameOutOfTime
on endGeoGame
when mouseDown then nothing
end endGeoGame
on success
endGeoGame
go frame "success"
end success
on ResetTimeOut
set the timeOutLapsed to 0
set the timeOutLength to 60*45 -- 45 seconds
end
on TimeOutOn
resetTimeOut
set the timeOutMouse to true
set the timeOutKeyDown to true
set the timeOutPlay to false
end
on TimeOutOff
resetTimeOut
set the timeOutMouse to false
set the timeOutKeyDown to false
set the timeOutPlay to true
when timeOut then nothing
end