home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 1997 September / Personal_Computer_World_Sep_97.iso / Democd3 / oasquiz.dxr / 00166.ls < prev    next >
Encoding:
Text File  |  1997-06-04  |  4.7 KB  |  177 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 Rand_Sound to random(5)
  29.   if true_answer = "3" then
  30.     if Rand_Sound = 1 then
  31.       puppetSound("funkbit2")
  32.     end if
  33.     if Rand_Sound = 2 then
  34.       puppetSound("funkbit3")
  35.     end if
  36.     if Rand_Sound = 3 then
  37.       puppetSound("funkbit2")
  38.     end if
  39.     if Rand_Sound = 4 then
  40.       puppetSound("rockbit6")
  41.     end if
  42.     if Rand_Sound = 5 then
  43.       puppetSound("rockbit5")
  44.     end if
  45.     set inarow to inarow + 1
  46.     set qright to qright + 1
  47.     set the visible of sprite 26 to 1
  48.     set the locH of sprite 26 to 433
  49.     set the locV of sprite 26 to 199
  50.     updateStage()
  51.     repeat with n = 155 to 160
  52.       set the castNum of sprite 26 to n
  53.       updateStage()
  54.       startTimer()
  55.       repeat while the timer < 5
  56.         nothing()
  57.       end repeat
  58.     end repeat
  59.     startTimer()
  60.     repeat while the timer < 50
  61.       nothing()
  62.     end repeat
  63.     set the visible of sprite 8 to 0
  64.     set oldlevel to level
  65.     set level to level + 1
  66.     set leveldiff to oldlevel - level
  67.     set scored to scored + 1
  68.     set the visible of sprite 20 to 1
  69.   end if
  70.   if true_answer <> "3" then
  71.     set inarow to 0
  72.     if Rand_Sound = 1 then
  73.       puppetSound("bluebit2")
  74.     end if
  75.     if Rand_Sound = 2 then
  76.       puppetSound("bluebit3")
  77.     end if
  78.     if Rand_Sound = 3 then
  79.       puppetSound("bluebit9")
  80.     end if
  81.     if Rand_Sound = 4 then
  82.       puppetSound("blubit11")
  83.     end if
  84.     if Rand_Sound = 5 then
  85.       puppetSound("bluebit6")
  86.     end if
  87.     set qwrong to qwrong + 1
  88.     set the visible of sprite 26 to 1
  89.     repeat with n = 257 to 265
  90.       set the castNum of sprite 26 to n
  91.       updateStage()
  92.       startTimer()
  93.       repeat while the timer < 5
  94.         nothing()
  95.       end repeat
  96.     end repeat
  97.     startTimer()
  98.     repeat while the timer < 50
  99.       nothing()
  100.     end repeat
  101.     set oldlevel to level
  102.     set level to level - random(level)
  103.     if gameover = 1 then
  104.       set level to 0
  105.     end if
  106.     set the visible of sprite 21 to 1
  107.   end if
  108.   set the blend of sprite 17 to 55
  109.   set the visible of sprite 22 to 0
  110.   set the visible of sprite 23 to 0
  111.   updateStage()
  112.   startTimer()
  113.   set the visible of sprite 20 to 0
  114.   set the visible of sprite 21 to 0
  115.   set the visible of sprite 24 to 0
  116.   set counter to counter + 1
  117.   set the blend of sprite 17 to 0
  118.   updateStage()
  119.   set the blend of sprite 37 to 0
  120.   set the blend of sprite 38 to 0
  121.   set the blend of sprite 48 to 0
  122.   if level < 0 then
  123.     set level to 0
  124.   end if
  125.   repeat while soundBusy(1) = 1
  126.   end repeat
  127.   if level > oldlevel then
  128.     puppetSound("rise1")
  129.     if the castNum of sprite 12 <> 296 then
  130.       set the castNum of sprite 12 to the castNum of sprite 12 + 1
  131.       updateStage()
  132.     end if
  133.   else
  134.     if (level < oldlevel) and (counter > 0) then
  135.       puppetSound("fall1")
  136.     end if
  137.   end if
  138.   if level > highest then
  139.     set highest to level
  140.   end if
  141.   set the visible of sprite 19 to 0
  142.   set the visible of sprite 22 to 0
  143.   set the visible of sprite 23 to 0
  144.   set the visible of sprite 24 to 0
  145.   updateStage()
  146.   if level = 0 then
  147.     puppetSound("fall1")
  148.     set plost to 1
  149.     set notend to 0
  150.     go("end")
  151.     exit
  152.   end if
  153.   if level = 20 then
  154.     set notend to 0
  155.     set pwon to 1
  156.     go("end")
  157.     exit
  158.   end if
  159.   if (counter = 60) and (level <> 20) then
  160.     set notend to 0
  161.     set pend to 1
  162.     go("end")
  163.     exit
  164.   end if
  165.   set the visible of sprite 22 to 0
  166.   set the visible of sprite 23 to 0
  167.   set the visible of sprite 24 to 0
  168.   set the visible of sprite 8 to 0
  169.   set the visible of sprite 19 to 0
  170.   set the visible of sprite 20 to 1
  171.   updateStage()
  172.   set the visible of sprite 20 to 0
  173.   updateStage()
  174.   set notend to 1
  175.   go("end")
  176. end
  177.