home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1997 February / WPCFEB97.ISO / dxrs / jukebx02.dxr / 00032_Bubbles.ls < prev    next >
Encoding:
Text File  |  1996-12-09  |  5.6 KB  |  172 lines

  1. on bubbleVariables
  2.   global Inc, radius, deg, Bubblecentreh, Bubblecentrev, Bubble1Counter, Bubblecentreh2, Bubblecentrev2, radius2, bubble2flag, bubble5flag, bubble6flag, bubble7flag, bubble8flag, bubble5counter, bubble6counter, bubble7counter, bubble8counter
  3.   set bubble2flag to 0
  4.   set bubble5flag to 0
  5.   set bubble6flag to 0
  6.   set bubble7flag to 0
  7.   set bubble8flag to 0
  8.   set Bubble1Counter to 180
  9.   set bubble5counter to 180
  10.   set bubble6counter to 180
  11.   set bubble7counter to 180
  12.   set bubble8counter to 180
  13.   set the visible of sprite 30 to 0
  14.   set the visible of sprite 31 to 0
  15.   set the visible of sprite 32 to 0
  16.   set the visible of sprite 33 to 0
  17.   set the visible of sprite 34 to 0
  18.   set the visible of sprite 35 to 0
  19.   set Bubblecentrev to the locV of sprite 30
  20.   set Bubblecentreh to the locH of sprite 5
  21.   set radius to Bubblecentreh - the locH of sprite 30
  22.   set deg to PI / 180.0
  23.   set Inc to 1
  24.   set Bubblecentrev2 to the locV of sprite 31
  25.   set Bubblecentreh2 to the locH of sprite 5 - 32
  26.   set radius2 to Bubblecentreh2 - the locH of sprite 31
  27. end
  28.  
  29. on BubbleAnimation
  30.   global bubble2flag, bubble5flag, bubble6flag, bubble7flag, bubble8flag
  31.   set Rand to random(200)
  32.   Bubble1Animation()
  33.   if bubble2flag = 1 then
  34.     bubble2animation()
  35.   end if
  36.   if ((Rand > 15) and (Rand < 20)) or (bubble5flag = 1) then
  37.     bubble5animation()
  38.   end if
  39.   if ((Rand > 20) and (Rand < 25)) or (bubble6flag = 1) then
  40.     bubble6animation()
  41.   end if
  42.   if ((Rand > 25) and (Rand < 30)) or (bubble7flag = 1) then
  43.     bubble7animation()
  44.   end if
  45.   if ((Rand > 30) and (Rand < 35)) or (bubble8flag = 1) then
  46.     bubble8animation()
  47.   end if
  48. end
  49.  
  50. on Bubble1Animation
  51.   global Bubble1Counter, Bubblecentreh, Bubblecentrev, Inc, radius, deg
  52.   set the visible of sprite 30 to 1
  53.   set newinc to Bubble1Counter * Inc
  54.   set the locH of sprite 30 to Bubblecentreh + (radius * cos(newinc * deg))
  55.   set the locV of sprite 30 to Bubblecentrev - (radius * sin(newinc * deg))
  56.   set Bubble1Counter to Bubble1Counter - 1
  57.   if Bubble1Counter = 111 then
  58.     set Bubble1Counter to 180
  59.   end if
  60.   if rollOver(30) and the mouseDown then
  61.     puppetSound(3, 148)
  62.     set the visible of sprite 30 to 0
  63.     set Bubble1Counter to 180
  64.   end if
  65.   updateStage()
  66. end
  67.  
  68. on bubble2animation
  69.   global radius2, Bubblecentreh2, Bubblecentrev2, deg, bubble2counter, Inc, bubble2flag
  70.   set the visible of sprite 31 to 1
  71.   set bubble2flag to 1
  72.   set newinc to bubble2counter * Inc
  73.   set the locH of sprite 31 to Bubblecentreh2 + (radius2 * cos(newinc * deg))
  74.   set the locV of sprite 31 to Bubblecentrev2 + (radius2 * sin(newinc * deg))
  75.   set bubble2counter to bubble2counter - 1
  76.   if bubble2counter = 111 then
  77.     set bubble2counter to 180
  78.     set bubble2flag to 0
  79.     set the visible of sprite 31 to 0
  80.   end if
  81.   if rollOver(31) and the mouseDown then
  82.     puppetSound(3, 148)
  83.     set the visible of sprite 31 to 0
  84.     set bubble2counter to 180
  85.   end if
  86.   updateStage()
  87. end
  88.  
  89. on bubble5animation
  90.   global radius, Bubblecentreh, Bubblecentrev, deg, bubble5flag, bubble5counter, Inc
  91.   set the visible of sprite 32 to 1
  92.   set bubble5flag to 1
  93.   set newinc to bubble5counter * Inc
  94.   set the locH of sprite 32 to Bubblecentreh + (radius * cos(newinc * deg))
  95.   set the locV of sprite 32 to Bubblecentrev - (radius * sin(newinc * deg))
  96.   set bubble5counter to bubble5counter - 1
  97.   if bubble5counter = 111 then
  98.     set bubble5counter to 180
  99.     set bubble5flag to 0
  100.     set the visible of sprite 32 to 0
  101.   end if
  102.   if rollOver(32) and the mouseDown then
  103.     puppetSound(3, 148)
  104.     set the visible of sprite 32 to 0
  105.     set bubble5counter to 180
  106.   end if
  107.   updateStage()
  108. end
  109.  
  110. on bubble6animation
  111.   global radius2, Bubblecentreh2, Bubblecentrev2, deg, bubble6flag, bubble6counter, Inc
  112.   set the visible of sprite 33 to 1
  113.   set bubble6flag to 1
  114.   set newinc to bubble6counter * Inc
  115.   set the locH of sprite 33 to Bubblecentreh2 + (radius2 * cos(newinc * deg))
  116.   set the locV of sprite 33 to Bubblecentrev2 + (radius2 * sin(newinc * deg))
  117.   set bubble6counter to bubble6counter - 1
  118.   if bubble6counter = 111 then
  119.     set bubble6counter to 180
  120.     set bubble6flag to 0
  121.     set the visible of sprite 33 to 0
  122.   end if
  123.   if rollOver(33) and the mouseDown then
  124.     puppetSound(3, 148)
  125.     set the visible of sprite 33 to 0
  126.     set bubble6counter to 180
  127.   end if
  128.   updateStage()
  129. end
  130.  
  131. on bubble7animation
  132.   global radius2, Bubblecentreh2, Bubblecentrev2, deg, bubble7flag, bubble7counter, Inc
  133.   set the visible of sprite 34 to 1
  134.   set bubble7flag to 1
  135.   set newinc to bubble7counter * Inc
  136.   set the locH of sprite 34 to Bubblecentreh2 + (radius2 * cos(newinc * deg))
  137.   set the locV of sprite 34 to Bubblecentrev2 + (radius2 * sin(newinc * deg))
  138.   set bubble7counter to bubble7counter - 1
  139.   if bubble7counter = 111 then
  140.     set bubble7counter to 180
  141.     set bubble7flag to 0
  142.     set the visible of sprite 34 to 0
  143.   end if
  144.   if rollOver(34) and the mouseDown then
  145.     puppetSound(3, 148)
  146.     set the visible of sprite 34 to 0
  147.     set bubble7counter to 180
  148.   end if
  149.   updateStage()
  150. end
  151.  
  152. on bubble8animation
  153.   global radius, Bubblecentreh, Bubblecentrev, deg, bubble8flag, bubble8counter, Inc
  154.   set the visible of sprite 35 to 1
  155.   set bubble8flag to 1
  156.   set newinc to bubble8counter * Inc
  157.   set the locH of sprite 35 to Bubblecentreh + (radius * cos(newinc * deg))
  158.   set the locV of sprite 35 to Bubblecentrev - (radius * sin(newinc * deg))
  159.   set bubble8counter to bubble8counter - 1
  160.   if bubble8counter = 111 then
  161.     set bubble8counter to 180
  162.     set bubble8flag to 0
  163.     set the visible of sprite 35 to 0
  164.   end if
  165.   if rollOver(35) and the mouseDown then
  166.     puppetSound(3, 148)
  167.     set the visible of sprite 35 to 0
  168.     set bubble8counter to 180
  169.   end if
  170.   updateStage()
  171. end
  172.