home *** CD-ROM | disk | FTP | other *** search
/ Mind Games (Tessera) / MindGames.iso / mind_games / Files / quiz.dxr / Internal_5_TimerScript.ls < prev    next >
Encoding:
Text File  |  2002-11-22  |  925 b   |  39 lines

  1. global TotalPoints, QuestionsAsked, QuestionAnswered, gIsPaused_flag, gxronos, gMaxTime, gKrataTime, gMiaw_flag, thequit, gPauseAllowed
  2.  
  3. on exitFrame
  4.   if not gIsPaused_flag then
  5.     if not gMiaw_flag then
  6.       gPauseAllowed = 1
  7.       if QuestionsAsked = 0 then
  8.         StartTimerClockIsTicking()
  9.       end if
  10.       if QuestionAnswered then
  11.         StartTimerClockIsTicking()
  12.       else
  13.         gxronos = gMaxTime - (the timer / 60) - gKrataTime
  14.         if (gxronos <= 0) and not QuestionAnswered then
  15.           GoToNextQuestion()
  16.         end if
  17.       end if
  18.       member("TimeRemains").text = string(gxronos)
  19.     end if
  20.   end if
  21.   CheckSound()
  22.   if thequit then
  23.     go(1, "exitMov")
  24.   end if
  25.   go(the frame)
  26. end
  27.  
  28. on StartTimerClockIsTicking
  29.   startTimer()
  30. end
  31.  
  32. on GoToNextQuestion
  33.   gKrataTime = 0
  34.   StartTimerClockIsTicking()
  35.   sendAllSprites(#OpenDB)
  36.   sendAllSprites(#LoadCurrentQuestion)
  37.   sendAllSprites(#closeDB)
  38. end
  39.