home *** CD-ROM | disk | FTP | other *** search
/ Pro One: Netcracker Netscape Navigator / ProOne: Netcracker Netscape Navigator.iso / pc / nc / nct01080.geo / 00103.ls < prev    next >
Encoding:
Text File  |  1997-03-19  |  4.3 KB  |  185 lines

  1. on startMovie
  2.   Set_CDcounter(7)
  3.   initLesson()
  4.   CheckForTagWd()
  5. end
  6.  
  7. on InitLamp
  8.   set the visible of sprite 33 to 0
  9.   set the visible of sprite 34 to 0
  10.   UpdateCursors(32, 3)
  11.   UpdateCursors(34, 0)
  12.   set the castNum of sprite 32 to the number of cast "lamp_Off"
  13. end
  14.  
  15. on unSetMouseEvents
  16.   global puppetList
  17.   set puppetList to []
  18.   repeat with i = 1 to 48
  19.     add(puppetList, the puppet of sprite i)
  20.     if not (the puppet of sprite i) then
  21.       set the puppet of sprite i to 1
  22.     end if
  23.   end repeat
  24.   play frame "outLamp"
  25. end
  26.  
  27. on setMouseEvents
  28.   global puppetList
  29.   set the mouseDownScript to EMPTY
  30.   set the mouseUpScript to EMPTY
  31.   set the keyDownScript to EMPTY
  32.   set the keyUpScript to EMPTY
  33.   repeat with i = 1 to 48
  34.     if getAt(puppetList, i) = 0 then
  35.       set the puppet of sprite i to 0
  36.     end if
  37.   end repeat
  38.   play done
  39. end
  40.  
  41. on dont
  42.   dontPassEvent()
  43. end
  44.  
  45. on HandleLamp
  46.   sound stop 2
  47.   if the name of cast the castNum of sprite 32 = "lamp_On" then
  48.     set the castNum of sprite 32 to the number of cast "lamp_Off"
  49.     set the visible of sprite 33 to 0
  50.     set the visible of sprite 34 to 0
  51.     UpdateCursors(34, 0)
  52.     set the castNum of sprite 34 to the number of cast "EXITLAMP"
  53.     updateStage()
  54.     unSetMouseEvents()
  55.   else
  56.     set the castNum of sprite 32 to the number of cast "lamp_On"
  57.     UpdateCursors(34, 3)
  58.     set the visible of sprite 33 to 1
  59.     set the visible of sprite 34 to 1
  60.     updateStage()
  61.     PlaySound("NCT01080.T01")
  62.     displayTip(34)
  63.   end if
  64.   updateStage()
  65. end
  66.  
  67. on displayTip theExitBtnSp
  68.   global exitTheLoop
  69.   set exitTheLoop to 0
  70.   set the mouseDownScript to "dont"
  71.   set the mouseUpScript to "dont"
  72.   set the keyDownScript to "dont"
  73.   set the keyUpScript to "dont"
  74.   set the exitLock to 0
  75.   repeat while not exitTheLoop
  76.     if the mouseCast = the number of cast "EXITLAMP" then
  77.       set the cursor of sprite 48 to [404, 405]
  78.     else
  79.       set the cursor of sprite 48 to [400, 401]
  80.     end if
  81.     if the mouseDown and (the mouseCast = the number of cast "EXITLAMP") then
  82.       switchExitLampButt(theExitBtnSp, "EXITLAMP_D")
  83.       next repeat
  84.     end if
  85.     if the commandDown and ((the key = "Q") or (the key = ".")) then
  86.       handleQuit()
  87.     end if
  88.   end repeat
  89.   set the exitLock to 1
  90.   set the cursor of sprite 48 to 0
  91.   HandleLamp()
  92. end
  93.  
  94. on switchExitLampButt spriteNum, castDown
  95.   global exitTheLoop
  96.   set flag to 0
  97.   set SaveCast to the castNum of sprite spriteNum
  98.   set flag to swapExitLampCast(spriteNum, SaveCast, castDown)
  99.   repeat while the mouseDown
  100.     set flag to swapExitLampCast(spriteNum, SaveCast, castDown)
  101.   end repeat
  102.   if flag = 1 then
  103.     set exitTheLoop to 1
  104.   end if
  105. end
  106.  
  107. on swapExitLampCast spriteNum, SaveCast, castDown
  108.   if rollOver(spriteNum) then
  109.     set the castNum of sprite spriteNum to the number of cast castDown
  110.     updateStage()
  111.     return 1
  112.   else
  113.     set the castNum of sprite spriteNum to the number of cast SaveCast
  114.     updateStage()
  115.     return 0
  116.   end if
  117. end
  118.  
  119. on TheinitCursor
  120.   initCursorCastNum()
  121.   initCursorList(1)
  122.   set CursorCastNum to getCursor(2)
  123.   cursor([CursorCastNum, CursorCastNum + 1])
  124. end
  125.  
  126. on checkScreenStatus
  127.   CheckRollOver()
  128.   CheckSnakeStatus()
  129.   go(the frame)
  130. end
  131.  
  132. on BlinkNext
  133.   if (the timer > getTimer()) and not soundBusy(2) then
  134.     startTimer()
  135.     if the name of cast the castNum of sprite get_NEXTSprite() = "NEXT" then
  136.       set the castNum of sprite get_NEXTSprite() to the number of cast "NEXT_E"
  137.     else
  138.       set the castNum of sprite get_NEXTSprite() to the number of cast "NEXT"
  139.     end if
  140.   end if
  141. end
  142.  
  143. on PressBtn theBtn
  144.   Set_PressedLast(theBtn)
  145.   switchButt(Get_AnsSprite() + theBtn - 1, "down" & theBtn, "HandleBtn" && theBtn)
  146. end
  147.  
  148. on GoNext
  149.   if not get_Disabled() then
  150.     sound stop 2
  151.     if Get_NEXT() > 12 then
  152.       GoNextMovie()
  153.     else
  154.       go("t" & Get_NEXT())
  155.     end if
  156.     Set_NEXT(Get_NEXT() + 1)
  157.   end if
  158. end
  159.  
  160. on stopMovie
  161.   sound stop 1
  162.   unLoad()
  163.   setEmptyCursor()
  164. end
  165.  
  166. on GoNextMovie
  167.   PlaySound("GOSOUND.SO1")
  168.   SaveHilite()
  169.   Add_CDcounter(1)
  170.   set cdNum to Get_CDcounter()
  171.   set movieName to item cdNum of Get_CurrentSnakeScreens()
  172.   go("INIT" & Get_ScreenSubject(), movieName & ".GEO")
  173. end
  174.  
  175. on playTheTSound theTSnd
  176.   PlaySound("NCT01080.s0" & theTSnd)
  177. end
  178.  
  179. on LampShutDown
  180.   set the visible of sprite 33 to 0
  181.   UpdateCursors(33, 0)
  182.   set the puppet of sprite 32 to 0
  183.   UpdateCursors(32, 0)
  184. end
  185.