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