home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / PegScramble.dxr / 00001.ls next >
Encoding:
Text File  |  2002-01-25  |  3.7 KB  |  104 lines

  1. on exitFrame me
  2.   global spinPieChartRate, maximumPegs, pegData, holeData, spinFactor, playerlevel, totalCompleted, unfinishedSlots, homeLocations, levelTimer, panicTimer
  3.   totalCompleted = 0
  4.   unfinishedSlots = 0
  5.   holeData = []
  6.   spinPieChartRate = 0
  7.   playerlevel = playerlevel + 1
  8.   member("Level Display").text = "L" & string(playerlevel)
  9.   case playerlevel of
  10.     1:
  11.       ySpread = 35
  12.       circleQnt = [4, 8, 12, 0]
  13.       circleDist = [30, 60, 90, 0]
  14.       repeat with wCircle = 1 to 3
  15.         maxCircle = circleQnt[wCircle]
  16.         maxRadius = circleDist[wCircle] * 0.84999999999999998
  17.         aimModify = random(360 / maxCircle)
  18.         repeat with wHole = 1 to maxCircle
  19.           moveAim = (360 / maxCircle * wHole) + aimModify
  20.           moveSpeed = maxRadius * the width of sprite 5 / 200
  21.           add(holeData, [moveAim, moveSpeed, wCircle, random(360), random(16), 0])
  22.         end repeat
  23.       end repeat
  24.     2:
  25.       ySpread = 28
  26.       circleQnt = [2, 6, 8, 16]
  27.       circleDist = [15, 40, 65, 95]
  28.       repeat with wCircle = 1 to 4
  29.         maxCircle = circleQnt[wCircle]
  30.         maxRadius = circleDist[wCircle] * 0.84999999999999998
  31.         aimModify = random(360 / maxCircle)
  32.         repeat with wHole = 1 to maxCircle
  33.           moveAim = (360 / maxCircle * wHole) + aimModify
  34.           moveSpeed = maxRadius * the width of sprite 5 / 200
  35.           add(holeData, [moveAim, moveSpeed, wCircle, random(360), random(16), 0])
  36.         end repeat
  37.       end repeat
  38.     3:
  39.       ySpread = 24
  40.       circleQnt = [5, 10, 13, 20]
  41.       circleDist = [23, 50, 75, 100]
  42.       repeat with wCircle = 1 to 4
  43.         maxCircle = circleQnt[wCircle]
  44.         maxRadius = circleDist[wCircle] * 0.84999999999999998
  45.         aimModify = random(360 / maxCircle)
  46.         repeat with wHole = 1 to maxCircle
  47.           moveAim = (360 / maxCircle * wHole) + aimModify
  48.           moveSpeed = maxRadius * the width of sprite 5 / 200
  49.           add(holeData, [moveAim, moveSpeed, wCircle, random(360), random(16), 0])
  50.         end repeat
  51.       end repeat
  52.   end case
  53.   spinFactor = [0, 0, 0, 0]
  54.   maximumPegs = circleQnt[1] + circleQnt[2] + circleQnt[3] + circleQnt[4]
  55.   xLoc = -1
  56.   yloc = 0
  57.   repeat with wSlot = 1 to 50
  58.     wSprite = 100 + wSlot
  59.     set the loc of sprite wSprite to point(-50, -50)
  60.   end repeat
  61.   repeat with wSlot = 1 to 50
  62.     wSprite = 30 + wSlot
  63.     set the loc of sprite wSprite to point(-50, -50)
  64.   end repeat
  65.   pegData = []
  66.   homeLocations = []
  67.   repeat with wPeg = 1 to count(holeData)
  68.     wSprite = 100 + wPeg
  69.     xLoc = xLoc + 1
  70.     if xLoc > 2 then
  71.       xLoc = 0
  72.       yloc = yloc + 1
  73.     end if
  74.     xmod = [0, 20][(yloc mod 2) + 1]
  75.     ySpread = [45, 35, 23][playerlevel]
  76.     ymod = [30, 25, 25][playerlevel]
  77.     rloc = point(460, 20) + point((xLoc * 40) + xmod, (yloc * ySpread) + ymod) + point(random(5), random(5))
  78.     add(pegData, [rloc, random(360), holeData[wPeg][5], 0])
  79.     add(homeLocations, rloc)
  80.     set the loc of sprite wSprite to rloc
  81.   end repeat
  82.   drawSlots(1)
  83.   drawpegs()
  84.   repeat with wVector = 1 to 4
  85.     set the loc of sprite (10 + wVector) to the loc of sprite 5
  86.     sprite(10 + wVector).rotation = (wVector - 2) * 90
  87.   end repeat
  88.   set the loc of sprite 10 to the loc of sprite 5
  89.   drawChart(0)
  90.   repeat with wTicker = 1 to 60
  91.     testAim = 360 / 60 * wTicker
  92.     locY = integer(cos(testAim * PI / 180) * -210)
  93.     locX = integer(sin(testAim * PI / 180) * 210)
  94.     set the loc of sprite (200 + wTicker) to the loc of sprite 5 + point(locX, locY - 2)
  95.     sprite(200 + wTicker).locZ = 16
  96.     set the member of sprite (200 + wTicker) to "Red Bulb"
  97.     set the blend of sprite (200 + wTicker) to 40
  98.   end repeat
  99.   levelTimer = 0
  100.   panicTimer = 11
  101.   sprite(16).visible = 0
  102.   member("Panic Counter").text = "10"
  103. end
  104.