home *** CD-ROM | disk | FTP | other *** search
/ cyber.net interactivo 9 / cybernetinteractivo09.ISO / demos / kids / ggmd / demomenu.dxr / 00040.ls < prev    next >
Encoding:
Text File  |  1996-02-05  |  4.4 KB  |  179 lines

  1. on detecter
  2.   global shortlist, miceCaught
  3.   cursor(200)
  4.   repeat with x = 1 to the number of items in shortlist
  5.     set thesprite to value(item x of shortlist)
  6.     if rollOver(thesprite) then
  7.       alarm()
  8.     end if
  9.   end repeat
  10.   set the castNum of sprite 25 to the number of cast "detectoff"
  11.   set the locH of sprite 25 to the mouseH
  12.   set the locV of sprite 25 to the mouseV
  13.   updateStage()
  14. end
  15.  
  16. on select
  17.   global myroom, shortlist, spritelist, theselsprite, mysound
  18.   repeat with x = 1 to the number of items in shortlist
  19.     set mysprite to value(item x of shortlist)
  20.     if rollOver(mysprite) then
  21.       set theselsprite to mysprite
  22.       set myroom to line mysprite - 4 of field "roomlist"
  23.       set mysound to line mysprite - 4 of field "soundlist"
  24.       puppetSprite(25, 0)
  25.       put spritelist
  26.       go("room")
  27.       set the mouseDownScript to EMPTY
  28.     end if
  29.   end repeat
  30. end
  31.  
  32. on musicon
  33.   global music
  34.   set music to 1
  35.   set the castNum of sprite 5 to the number of cast "m1"
  36. end
  37.  
  38. on musicoff
  39.   global music
  40.   set music to 0
  41.   set the castNum of sprite 5 to the number of cast "m2"
  42. end
  43.  
  44. on slow
  45.   global mytempo, numtraps
  46.   set numtraps to 10
  47.   set mytempo to 8
  48.   set the castNum of sprite 4 to the number of cast "l1"
  49. end
  50.  
  51. on medium
  52.   global mytempo, numtraps
  53.   set numtraps to 5
  54.   set mytempo to 12
  55.   set the castNum of sprite 4 to the number of cast "l2"
  56. end
  57.  
  58. on fast
  59.   global mytempo, numtraps
  60.   set numtraps to 0
  61.   set mytempo to 16
  62.   set the castNum of sprite 4 to the number of cast "l3"
  63. end
  64.  
  65. on mainstart
  66.   global spritelist, thehdpath, music, mytempo, WhereAmI
  67.   set spritelist to list(7, 17)
  68.   buildorchestra()
  69.   set music to 1
  70.   set mytempo to 8
  71.   set WhereAmI to "menu"
  72. end
  73.  
  74. on startmenu
  75.   global myroom
  76.   set myroom to line random(19) of field "roomlist"
  77.   cursor(200)
  78.   selectlist()
  79. end
  80.  
  81. on selectlist
  82.   global spritelist, shortlist, thecdpath
  83.   set templist to value(string(spritelist))
  84.   set shortlist to EMPTY
  85.   if count(templist) = 0 then
  86.     go(1, "credits")
  87.     exit
  88.   end if
  89.   if count(templist) = 2 then
  90.     put getAt(templist, 1) into item 1 of shortlist
  91.     put getAt(templist, 2) into item 2 of shortlist
  92.   else
  93.     if count(templist) = 1 then
  94.       put getAt(templist, 1) into item 1 of shortlist
  95.     else
  96.       repeat with x = 1 to 3
  97.         set listnum to count(templist)
  98.         set mynum to random(listnum)
  99.         put getAt(templist, mynum) into item x of shortlist
  100.         deleteAt(templist, mynum)
  101.       end repeat
  102.     end if
  103.   end if
  104. end
  105.  
  106. on alarm
  107.   set the castNum of sprite 25 to the number of cast "detecton"
  108.   updateStage()
  109.   if not (the soundBusy of 1) then
  110.     puppetSound("short siren")
  111.   end if
  112.   wait(10)
  113. end
  114.  
  115. on gotomovie
  116.   global myroom, thecdpath, mysound
  117.   go(1, the pathName & myroom)
  118.   cursor(200)
  119. end
  120.  
  121. on interfacehelp
  122.   go("help")
  123.   set the timeoutLapsed to 0
  124.   puppetSprite(25, 0)
  125. end
  126.  
  127. on loadgame
  128.   global thehdpath, savename, saveinfo
  129.   put EMPTY into field "savelist"
  130.   set myfile to FileIO(mnew, "read", thehdpath & "saveinfo.txt")
  131.   if objectp(myfile) then
  132.     set saveinfo to myfile(mReadFile)
  133.     myfile(mdispose)
  134.     if saveinfo = EMPTY then
  135.       alert("no games saved")
  136.       go("start")
  137.     else
  138.       repeat with x = 1 to the number of lines in saveinfo
  139.         put char 1 to 32 of item 1 of line x of saveinfo & RETURN after field "savelist"
  140.       end repeat
  141.     end if
  142.     set savename to field "savelist"
  143.     updateStage()
  144.   else
  145.     go("start")
  146.   end if
  147. end
  148.  
  149. on selectedgame
  150.   global saveinfo, miceCaught, spritelist, mytempo, theBuild, playList, music, numtraps, trapsdone
  151.   set myline to the mouseLine
  152.   if line myline of saveinfo <> EMPTY then
  153.     set miceCaught to value(item 2 of line myline of saveinfo)
  154.     set mytempo to value(item 3 of line myline of saveinfo)
  155.     set numtraps to value(item 4 of line myline of saveinfo)
  156.     set music to value(item 5 of line myline of saveinfo)
  157.     set theBuild to item 6 of line myline of saveinfo
  158.     set thelist to item 7 to 25 - miceCaught of line myline of saveinfo
  159.     set spritelist to value(thelist)
  160.     set tot to the number of items in line myline of saveinfo
  161.     if music then
  162.       set theplay to item 26 - miceCaught to 25 of line myline of saveinfo
  163.       set playList to value(theplay)
  164.       set trapsdone to item 26 to tot of line myline of saveinfo
  165.     else
  166.       set trapsdone to item 27 - miceCaught to tot of line myline of saveinfo
  167.     end if
  168.     if music then
  169.       rebuildorchestra()
  170.     end if
  171.     go("options")
  172.   end if
  173. end
  174.  
  175. on wait n
  176.   repeat with x = 1 to n * 60
  177.   end repeat
  178. end
  179.