home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 1997 September / Personal_Computer_World_Sep_97.iso / Democd3 / oasquiz.dxr / 00220.ls < prev    next >
Encoding:
Text File  |  1997-06-04  |  4.7 KB  |  171 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, disable
  3.   if disable = 0 then
  4.     set disable to 1
  5.     set the visible of sprite 20 to 0
  6.     set the volume of sound 1 to 250
  7.     puppetSound("click")
  8.     set the visible of sprite 13 to 0
  9.     set the visible of sprite 28 to 0
  10.     set the visible of sprite 29 to 0
  11.     set the visible of sprite 30 to 0
  12.     set the locH of sprite 6 to the locH of sprite 6 + 2
  13.     set the locV of sprite 6 to the locV of sprite 6 + 2
  14.     set the locH of sprite 23 to the locH of sprite 23 + 2
  15.     set the locV of sprite 23 to the locV of sprite 23 + 2
  16.     updateStage()
  17.     startTimer()
  18.     repeat while the timer < 15
  19.       nothing()
  20.     end repeat
  21.     set the locH of sprite 6 to the locH of sprite 6 - 2
  22.     set the locV of sprite 6 to the locV of sprite 6 - 2
  23.     set the locH of sprite 23 to the locH of sprite 23 - 2
  24.     set the locV of sprite 23 to the locV of sprite 23 - 2
  25.     updateStage()
  26.     set the blend of sprite 47 to 60
  27.     set the blend of sprite 37 to 45
  28.     set the blend of sprite 39 to 45
  29.     set Rand_Sound to random(5)
  30.     if true_answer = "2" then
  31.       set inarow to inarow + 1
  32.       if Rand_Sound = 1 then
  33.         puppetSound("funkbit2")
  34.       end if
  35.       if Rand_Sound = 2 then
  36.         puppetSound("funkbit3")
  37.       end if
  38.       if Rand_Sound = 3 then
  39.         puppetSound("funkbit2")
  40.       end if
  41.       if Rand_Sound = 4 then
  42.         puppetSound("rockbit6")
  43.       end if
  44.       if Rand_Sound = 5 then
  45.         puppetSound("rockbit5")
  46.       end if
  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 270
  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 qright to qright + 1
  68.       set scored to scored + 1
  69.       set the visible of sprite 20 to 1
  70.     end if
  71.     if true_answer <> "2" then
  72.       set inarow to 0
  73.       set qwrong to qwrong + 1
  74.       if Rand_Sound = 1 then
  75.         puppetSound("bluebit7")
  76.       end if
  77.       if Rand_Sound = 2 then
  78.         puppetSound("bluebit3")
  79.       end if
  80.       if Rand_Sound = 3 then
  81.         puppetSound("bluebit9")
  82.       end if
  83.       if Rand_Sound = 4 then
  84.         puppetSound("blubit11")
  85.       end if
  86.       if Rand_Sound = 5 then
  87.         puppetSound("bluebit6")
  88.       end if
  89.       set the visible of sprite 12 to 1
  90.       set the visible of sprite 26 to 1
  91.       set the locV of sprite 26 to 270
  92.       repeat with n = 257 to 265
  93.         set the castNum of sprite 26 to n
  94.         updateStage()
  95.         startTimer()
  96.         repeat while the timer < 5
  97.           nothing()
  98.         end repeat
  99.       end repeat
  100.       startTimer()
  101.       repeat while the timer < 50
  102.         nothing()
  103.       end repeat
  104.       set oldlevel to level
  105.       set n to random(level - 1)
  106.       set level to level - n
  107.       if gameover = 1 then
  108.         set level to 0
  109.       end if
  110.       set the visible of sprite 21 to 1
  111.     end if
  112.     updateStage()
  113.     startTimer()
  114.     set the blend of sprite 16 to 0
  115.     set the visible of sprite 20 to 0
  116.     updateStage()
  117.     set counter to counter + 1
  118.     if level < 0 then
  119.       set level to 0
  120.     end if
  121.     repeat while soundBusy(1) = 1
  122.     end repeat
  123.     if level > oldlevel then
  124.       puppetSound("ding2")
  125.     end if
  126.     if level < oldlevel then
  127.       puppetSound("jewharp1")
  128.     end if
  129.     if the castNum of sprite 12 <> 296 then
  130.       set the castNum of sprite 12 to level + 275
  131.       updateStage()
  132.     end if
  133.     set the visible of sprite 19 to 0
  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 22 to 0
  158.     set the visible of sprite 23 to 0
  159.     set the visible of sprite 24 to 0
  160.     set the visible of sprite 26 to 0
  161.     set the visible of sprite 8 to 0
  162.     set the visible of sprite 19 to 0
  163.     set the visible of sprite 20 to 1
  164.     updateStage()
  165.     set the visible of sprite 20 to 0
  166.     updateStage()
  167.     set notend to 1
  168.     go("trans")
  169.   end if
  170. end
  171.