home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 1997 September / Personal_Computer_World_Sep_97.iso / Democd3 / oasquiz.dxr / 00147.ls < prev    next >
Encoding:
Text File  |  1997-06-04  |  6.9 KB  |  259 lines

  1. on mouseDown
  2.   global ans2, true_answer, Rand_Quest, guess, counter, n, oldlevel, x, leveldiff, scored, Rand_Sound, level, highest, qright, qwrong, plost, pwon, pend, notend, inarow, gameover, soundon
  3.   set the visible of sprite 20 to 0
  4.   set the volume of sound 1 to 250
  5.   puppetSound("click")
  6.   set the visible of sprite 13 to 0
  7.   set the visible of sprite 28 to 0
  8.   set the visible of sprite 29 to 0
  9.   set the visible of sprite 30 to 0
  10.   set the locH of sprite 6 to the locH of sprite 6 + 2
  11.   set the locV of sprite 6 to the locV of sprite 6 + 2
  12.   set the locH of sprite 23 to the locH of sprite 23 + 2
  13.   set the locV of sprite 23 to the locV of sprite 23 + 2
  14.   updateStage()
  15.   startTimer()
  16.   repeat while the timer < 15
  17.     nothing()
  18.   end repeat
  19.   set the locH of sprite 6 to the locH of sprite 6 - 2
  20.   set the locV of sprite 6 to the locV of sprite 6 - 2
  21.   set the locH of sprite 23 to the locH of sprite 23 - 2
  22.   set the locV of sprite 23 to the locV of sprite 23 - 2
  23.   updateStage()
  24.   set the visible of sprite 12 to 0
  25.   set the blend of sprite 47 to 60
  26.   set the blend of sprite 37 to 45
  27.   set the blend of sprite 39 to 45
  28.   set Rand_Sound to random(5)
  29.   set the visible of sprite 8 to 1
  30.   set the locV of sprite 8 to 340
  31.   repeat with n = 1 to 100
  32.     set the locH of sprite 8 to n
  33.     updateStage()
  34.   end repeat
  35.   set Rand_Sound to random(5)
  36.   if true_answer = "2" then
  37.     set inarow to inarow + 1
  38.     if Rand_Sound = 1 then
  39.       puppetSound("funkbit2")
  40.     end if
  41.     if Rand_Sound = 2 then
  42.       puppetSound("funkbit3")
  43.     end if
  44.     if Rand_Sound = 3 then
  45.       puppetSound("funkbit2")
  46.     end if
  47.     if Rand_Sound = 4 then
  48.       puppetSound("rockbit6")
  49.     end if
  50.     if Rand_Sound = 5 then
  51.       puppetSound("rockbit5")
  52.     end if
  53.     set the castNum of sprite 8 to 173
  54.     updateStage()
  55.     repeat with n = 1 to 25
  56.       set vert to the locV of sprite 8
  57.       set the locV of sprite 8 to vert - n
  58.       startTimer()
  59.       repeat while the timer < 1
  60.       end repeat
  61.       updateStage()
  62.     end repeat
  63.     set the castNum of sprite 8 to 193
  64.     updateStage()
  65.     startTimer()
  66.     repeat while the timer < 8
  67.       nothing()
  68.     end repeat
  69.     set the castNum of sprite 8 to 194
  70.     updateStage()
  71.     startTimer()
  72.     repeat while the timer < 8
  73.       nothing()
  74.     end repeat
  75.     set the castNum of sprite 8 to 173
  76.     updateStage()
  77.     repeat with n = 1 to 25
  78.       set vert to the locV of sprite 8
  79.       set the locV of sprite 8 to vert + n
  80.       startTimer()
  81.       repeat while the timer < 1
  82.       end repeat
  83.       updateStage()
  84.     end repeat
  85.     set the castNum of sprite 8 to 196
  86.     set the height of sprite 8 to 26
  87.     set the width of sprite 8 to 26
  88.     updateStage()
  89.     repeat with n = 1 to 8
  90.       set the height of sprite 8 to the height of sprite 8 + n
  91.       set the width of sprite 8 to the width of sprite 8 + n
  92.       updateStage()
  93.     end repeat
  94.     startTimer()
  95.     repeat while the timer < 50
  96.       nothing()
  97.     end repeat
  98.     set the visible of sprite 8 to 0
  99.     set oldlevel to level
  100.     set level to level + 1
  101.     set leveldiff to oldlevel - level
  102.     set qright to qright + 1
  103.     set scored to scored + 1
  104.     set the visible of sprite 20 to 1
  105.   end if
  106.   if true_answer <> "2" then
  107.     set inarow to 0
  108.     set qwrong to qwrong + 1
  109.     if Rand_Sound = 1 then
  110.       puppetSound("bluebit7")
  111.     end if
  112.     if Rand_Sound = 2 then
  113.       puppetSound("bluebit3")
  114.     end if
  115.     if Rand_Sound = 3 then
  116.       puppetSound("bluebit9")
  117.     end if
  118.     if Rand_Sound = 4 then
  119.       puppetSound("blubit11")
  120.     end if
  121.     if Rand_Sound = 5 then
  122.       puppetSound("bluebit6")
  123.     end if
  124.     set the castNum of sprite 8 to 174
  125.     updateStage()
  126.     repeat with n = 1 to 14
  127.       set vert to the locV of sprite 8
  128.       set the locV of sprite 8 to vert + n
  129.       startTimer()
  130.       repeat while the timer < 1
  131.       end repeat
  132.       updateStage()
  133.     end repeat
  134.     set the castNum of sprite 8 to 191
  135.     updateStage()
  136.     startTimer()
  137.     repeat while the timer < 8
  138.       nothing()
  139.     end repeat
  140.     set the castNum of sprite 8 to 192
  141.     updateStage()
  142.     startTimer()
  143.     repeat while the timer < 8
  144.       nothing()
  145.     end repeat
  146.     set the castNum of sprite 8 to 174
  147.     updateStage()
  148.     repeat with n = 1 to 14
  149.       set vert to the locV of sprite 8
  150.       set the locV of sprite 8 to vert - n
  151.       startTimer()
  152.       repeat while the timer < 1
  153.       end repeat
  154.       updateStage()
  155.     end repeat
  156.     set the castNum of sprite 8 to 195
  157.     set the height of sprite 8 to 26
  158.     set the width of sprite 8 to 26
  159.     updateStage()
  160.     repeat with n = 1 to 8
  161.       set the height of sprite 8 to the height of sprite 8 + n
  162.       set the width of sprite 8 to the width of sprite 8 + n
  163.       updateStage()
  164.     end repeat
  165.     startTimer()
  166.     repeat while the timer < 50
  167.       nothing()
  168.     end repeat
  169.     set oldlevel to level
  170.     set level to level - random(level)
  171.     if gameover = 1 then
  172.       set level to 0
  173.     end if
  174.     set the soundEnabled to 1
  175.     set the visible of sprite 21 to 1
  176.   end if
  177.   set the visible of sprite 22 to 0
  178.   set the visible of sprite 24 to 0
  179.   updateStage()
  180.   startTimer()
  181.   set the blend of sprite 16 to 0
  182.   set the visible of sprite 20 to 0
  183.   set the visible of sprite 21 to 0
  184.   set the visible of sprite 23 to 0
  185.   updateStage()
  186.   set counter to counter + 1
  187.   set the blend of sprite 37 to 0
  188.   set the blend of sprite 39 to 0
  189.   set the blend of sprite 47 to 0
  190.   if level < 0 then
  191.     set level to 0
  192.   end if
  193.   repeat while soundBusy(1) = 1
  194.   end repeat
  195.   if level > oldlevel then
  196.     puppetSound("rise1")
  197.     set vert to the locV of sprite 14
  198.     repeat with n = 1 to 15
  199.       set the locV of sprite 14 to vert - n
  200.       startTimer()
  201.       repeat while the timer < 3
  202.       end repeat
  203.       updateStage()
  204.     end repeat
  205.   else
  206.     if (level < oldlevel) and (oldlevel <> 0) then
  207.       puppetSound("fall1")
  208.       repeat with x = 1 to oldlevel - level
  209.         set vert to the locV of sprite 14
  210.         repeat with n = 1 to 15
  211.           set the locV of sprite 14 to vert + n
  212.           startTimer()
  213.           repeat while the timer < 3
  214.           end repeat
  215.           updateStage()
  216.         end repeat
  217.       end repeat
  218.     end if
  219.   end if
  220.   set the visible of sprite 19 to 0
  221.   set the visible of sprite 22 to 0
  222.   set the visible of sprite 23 to 0
  223.   set the visible of sprite 24 to 0
  224.   updateStage()
  225.   if level > highest then
  226.     set highest to level
  227.   end if
  228.   if level = 0 then
  229.     puppetSound("fall1")
  230.     set plost to 1
  231.     set notend to 0
  232.     go("end")
  233.     exit
  234.   end if
  235.   if level = 20 then
  236.     set notend to 0
  237.     set pwon to 1
  238.     go("end")
  239.     exit
  240.   end if
  241.   if (counter = 60) and (level <> 20) then
  242.     set pend to 1
  243.     set notend to 0
  244.     go("end")
  245.     exit
  246.   end if
  247.   set the visible of sprite 22 to 0
  248.   set the visible of sprite 23 to 0
  249.   set the visible of sprite 24 to 0
  250.   set the visible of sprite 8 to 0
  251.   set the visible of sprite 19 to 0
  252.   set the visible of sprite 20 to 1
  253.   updateStage()
  254.   set the visible of sprite 20 to 0
  255.   updateStage()
  256.   set notend to 1
  257.   go("end")
  258. end
  259.