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

  1. on mouseDown
  2.   global ans3, true_answer, Rand_Quest, guess, counter, scored, Rand_Sound, level, oldlevel, x, leveldiff, 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 7 to the locH of sprite 7 + 2
  11.   set the locV of sprite 7 to the locV of sprite 7 + 2
  12.   set the locH of sprite 24 to the locH of sprite 24 + 2
  13.   set the locV of sprite 24 to the locV of sprite 24 + 2
  14.   updateStage()
  15.   startTimer()
  16.   repeat while the timer < 15
  17.     nothing()
  18.   end repeat
  19.   set the locH of sprite 7 to the locH of sprite 7 - 2
  20.   set the locV of sprite 7 to the locV of sprite 7 - 2
  21.   set the locH of sprite 24 to the locH of sprite 24 - 2
  22.   set the locV of sprite 24 to the locV of sprite 24 - 2
  23.   updateStage()
  24.   set the visible of sprite 12 to 0
  25.   set the blend of sprite 37 to 45
  26.   set the blend of sprite 38 to 45
  27.   set the blend of sprite 48 to 65
  28.   set the visible of sprite 8 to 1
  29.   set the locV of sprite 8 to 440
  30.   repeat with n = 1 to 100
  31.     set the locH of sprite 8 to n
  32.     updateStage()
  33.   end repeat
  34.   set Rand_Sound to random(5)
  35.   if true_answer = "3" then
  36.     if Rand_Sound = 1 then
  37.       puppetSound("funkbit2")
  38.     end if
  39.     if Rand_Sound = 2 then
  40.       puppetSound("funkbit3")
  41.     end if
  42.     if Rand_Sound = 3 then
  43.       puppetSound("funkbit2")
  44.     end if
  45.     if Rand_Sound = 4 then
  46.       puppetSound("rockbit6")
  47.     end if
  48.     if Rand_Sound = 5 then
  49.       puppetSound("rockbit5")
  50.     end if
  51.     set inarow to inarow + 1
  52.     set qright to qright + 1
  53.     set the castNum of sprite 8 to 173
  54.     updateStage()
  55.     repeat with n = 1 to 29
  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 29
  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 scored to scored + 1
  103.     set the visible of sprite 20 to 1
  104.   end if
  105.   if true_answer <> "3" then
  106.     set inarow to 0
  107.     if Rand_Sound = 1 then
  108.       puppetSound("bluebit7")
  109.     end if
  110.     if Rand_Sound = 2 then
  111.       puppetSound("bluebit3")
  112.     end if
  113.     if Rand_Sound = 3 then
  114.       puppetSound("bluebit9")
  115.     end if
  116.     if Rand_Sound = 4 then
  117.       puppetSound("blubit11")
  118.     end if
  119.     if Rand_Sound = 5 then
  120.       puppetSound("bluebit6")
  121.     end if
  122.     set qwrong to qwrong + 1
  123.     set the castNum of sprite 8 to 174
  124.     updateStage()
  125.     repeat with n = 1 to 5
  126.       set vert to the locV of sprite 8
  127.       set the locV of sprite 8 to vert + n
  128.       startTimer()
  129.       repeat while the timer < 3
  130.       end repeat
  131.       updateStage()
  132.     end repeat
  133.     set the castNum of sprite 8 to 191
  134.     updateStage()
  135.     startTimer()
  136.     repeat while the timer < 8
  137.       nothing()
  138.     end repeat
  139.     set the castNum of sprite 8 to 192
  140.     updateStage()
  141.     startTimer()
  142.     repeat while the timer < 8
  143.       nothing()
  144.     end repeat
  145.     set the castNum of sprite 8 to 174
  146.     updateStage()
  147.     repeat with n = 1 to 5
  148.       set vert to the locV of sprite 8
  149.       set the locV of sprite 8 to vert - n
  150.       startTimer()
  151.       repeat while the timer < 3
  152.       end repeat
  153.       updateStage()
  154.     end repeat
  155.     set the castNum of sprite 8 to 195
  156.     set the height of sprite 8 to 26
  157.     set the width of sprite 8 to 26
  158.     updateStage()
  159.     repeat with n = 1 to 8
  160.       set the height of sprite 8 to the height of sprite 8 + n
  161.       set the width of sprite 8 to the width of sprite 8 + n
  162.       updateStage()
  163.     end repeat
  164.     startTimer()
  165.     repeat while the timer < 50
  166.       nothing()
  167.     end repeat
  168.     set oldlevel to level
  169.     set level to level - random(level)
  170.     if gameover = 1 then
  171.       set level to 0
  172.     end if
  173.     set the soundEnabled to 1
  174.     set the visible of sprite 21 to 1
  175.   end if
  176.   set the blend of sprite 17 to 55
  177.   set the visible of sprite 22 to 0
  178.   set the visible of sprite 23 to 0
  179.   updateStage()
  180.   startTimer()
  181.   set the visible of sprite 20 to 0
  182.   set the visible of sprite 21 to 0
  183.   set the visible of sprite 24 to 0
  184.   set counter to counter + 1
  185.   set the blend of sprite 17 to 0
  186.   updateStage()
  187.   set the blend of sprite 37 to 0
  188.   set the blend of sprite 38 to 0
  189.   set the blend of sprite 48 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 (counter > 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.   if level > highest then
  221.     set highest to level
  222.   end if
  223.   set the visible of sprite 19 to 0
  224.   set the visible of sprite 22 to 0
  225.   set the visible of sprite 23 to 0
  226.   set the visible of sprite 24 to 0
  227.   updateStage()
  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 notend to 0
  243.     set pend to 1
  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.