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

  1. on mouseDown
  2.   global ans2, true_answer, Rand_Quest, guess, counter, n, oldlevel, x, leveldiff, disable, scored, Rand_Sound, level, highest, qright, qwrong, plost, pwon, pend, notend, inarow, gameover, soundon
  3.   if disable = 0 then
  4.     set disable to 1
  5.     puppetSound(2, 0)
  6.     set the visible of sprite 20 to 0
  7.     set the volume of sound 1 to 250
  8.     puppetSound("click")
  9.     set the visible of sprite 13 to 0
  10.     set the visible of sprite 28 to 0
  11.     set the visible of sprite 29 to 0
  12.     set the visible of sprite 30 to 0
  13.     set the locH of sprite 6 to the locH of sprite 6 + 2
  14.     set the locV of sprite 6 to the locV of sprite 6 + 2
  15.     set the locH of sprite 23 to the locH of sprite 23 + 2
  16.     set the locV of sprite 23 to the locV of sprite 23 + 2
  17.     updateStage()
  18.     startTimer()
  19.     repeat while the timer < 15
  20.       nothing()
  21.     end repeat
  22.     set the locH of sprite 6 to the locH of sprite 6 - 2
  23.     set the locV of sprite 6 to the locV of sprite 6 - 2
  24.     set the locH of sprite 23 to the locH of sprite 23 - 2
  25.     set the locV of sprite 23 to the locV of sprite 23 - 2
  26.     updateStage()
  27.     set the blend of sprite 47 to 60
  28.     set the blend of sprite 37 to 45
  29.     set the blend of sprite 39 to 45
  30.     set Rand_Sound to random(5)
  31.     if true_answer = "2" then
  32.       set inarow to inarow + 1
  33.       if Rand_Sound = 1 then
  34.         puppetSound("funkbit2")
  35.       end if
  36.       if Rand_Sound = 2 then
  37.         puppetSound("funkbit3")
  38.       end if
  39.       if Rand_Sound = 3 then
  40.         puppetSound("funkbit2")
  41.       end if
  42.       if Rand_Sound = 4 then
  43.         puppetSound("rockbit6")
  44.       end if
  45.       if Rand_Sound = 5 then
  46.         puppetSound("rockbit5")
  47.       end if
  48.       set the visible of sprite 26 to 1
  49.       set the locH of sprite 26 to 433
  50.       set the locV of sprite 26 to 270
  51.       updateStage()
  52.       repeat with n = 155 to 160
  53.         set the castNum of sprite 26 to n
  54.         updateStage()
  55.         startTimer()
  56.         repeat while the timer < 5
  57.           nothing()
  58.         end repeat
  59.       end repeat
  60.       startTimer()
  61.       repeat while the timer < 50
  62.         nothing()
  63.       end repeat
  64.       set the visible of sprite 8 to 0
  65.       set oldlevel to level
  66.       set level to level + 1
  67.       set leveldiff to oldlevel - level
  68.       set qright to qright + 1
  69.       set scored to scored + 1
  70.       set the visible of sprite 20 to 1
  71.     end if
  72.     if true_answer <> "2" then
  73.       set inarow to 0
  74.       set qwrong to qwrong + 1
  75.       if Rand_Sound = 1 then
  76.         puppetSound("bluebit7")
  77.       end if
  78.       if Rand_Sound = 2 then
  79.         puppetSound("bluebit3")
  80.       end if
  81.       if Rand_Sound = 3 then
  82.         puppetSound("bluebit9")
  83.       end if
  84.       if Rand_Sound = 4 then
  85.         puppetSound("blubit11")
  86.       end if
  87.       if Rand_Sound = 5 then
  88.         puppetSound("bluebit6")
  89.       end if
  90.       set the visible of sprite 12 to 1
  91.       set the visible of sprite 26 to 1
  92.       set the locV of sprite 26 to 270
  93.       repeat with n = 257 to 265
  94.         set the castNum of sprite 26 to n
  95.         updateStage()
  96.         startTimer()
  97.         repeat while the timer < 5
  98.           nothing()
  99.         end repeat
  100.       end repeat
  101.       startTimer()
  102.       repeat while the timer < 50
  103.         nothing()
  104.       end repeat
  105.       set oldlevel to level
  106.       set n to random(level - 1)
  107.       set level to level - n
  108.       if gameover = 1 then
  109.         set level to 0
  110.       end if
  111.       set the visible of sprite 21 to 1
  112.     end if
  113.     updateStage()
  114.     startTimer()
  115.     set the blend of sprite 16 to 0
  116.     set the visible of sprite 20 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("ding2")
  126.     end if
  127.     if level < oldlevel then
  128.       puppetSound("jewharp1")
  129.     end if
  130.     if the castNum of sprite 12 <> 296 then
  131.       set the castNum of sprite 12 to level + 275
  132.       updateStage()
  133.     end if
  134.     updateStage()
  135.     if level > highest then
  136.       set highest to level
  137.     end if
  138.     if level = 0 then
  139.       puppetSound("jewharp1")
  140.       set plost to 1
  141.       set notend to 0
  142.       go("end")
  143.       exit
  144.     end if
  145.     if level >= 22 then
  146.       set notend to 0
  147.       set pwon to 1
  148.       go("end")
  149.       exit
  150.     end if
  151.     if (counter = 24) and (level <> 22) then
  152.       set pend to 1
  153.       set notend to 0
  154.       go("end")
  155.       exit
  156.     end if
  157.     set the visible of sprite 26 to 0
  158.     set the visible of sprite 8 to 0
  159.     set the visible of sprite 20 to 1
  160.     updateStage()
  161.     set the visible of sprite 20 to 0
  162.     updateStage()
  163.     set notend to 1
  164.     go("trans")
  165.   end if
  166. end
  167.