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 >
Text File  |  1996-06-16  |  1KB  |  70 lines

  1. on setTimer
  2.   
  3.   timeOutOff
  4.   global allotedSeconds
  5.   put 60 into allotedSeconds
  6.   
  7.   global gameStartTicks
  8.   put the ticks into gameStartTicks
  9.   set the text of cast "GameTimer" to string(allotedSeconds) 
  10.   
  11.   
  12. end 
  13.  
  14.  
  15. on timeElapsed
  16.   global gameStartTicks, allotedSeconds, gameOver
  17.   put allotedSeconds - ((the ticks - gameStartTicks) / 60) into gameSecondsRemain
  18.   set the text of cast "GameTimer" to string(gameSecondsRemain)
  19.   put false into gameOver
  20.   if gameSecondsRemain <= 0 then
  21.     set gameOver = TRUE
  22.     gameOutOfTime
  23.     return TRUE
  24.   end if
  25.   
  26. end
  27.  
  28.  
  29. on gameOutOfTime
  30.   endGeoGame -- switch off 'when mousedown then' stuff
  31.   playGameOver
  32. end gameOutOfTime
  33.  
  34.  
  35. on endGeoGame
  36.   when mouseDown then nothing
  37. end endGeoGame
  38.  
  39.  
  40. on success
  41.   endGeoGame
  42.   go frame "success"
  43. end success
  44.  
  45.  
  46. on ResetTimeOut
  47.   set the timeOutLapsed to 0
  48.   set the timeOutLength to 60*45 -- 45 seconds
  49. end
  50.  
  51.  
  52. on TimeOutOn
  53.   resetTimeOut
  54.   set the timeOutMouse to true
  55.   set the timeOutKeyDown to true
  56.   set the timeOutPlay to false
  57. end
  58.  
  59.  
  60. on TimeOutOff
  61.   resetTimeOut
  62.   set the timeOutMouse to false
  63.   set the timeOutKeyDown to false
  64.   set the timeOutPlay to true
  65.   when timeOut then nothing
  66. end
  67.  
  68.  
  69.  
  70.