home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / MazeCraze.dxr / 00006_gameMovie.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  2.2 KB  |  86 lines

  1. global gLevel, gShocked, gLifePoints, g1SecAhead, secs, mins, gPaused
  2.  
  3. on startMovie
  4.   cursor(200)
  5.   gPaused = 0
  6.   sound(5).volume = 30
  7.   puppetSound(5, "fan_wind2")
  8.   sprite(44).visible = 1
  9.   sprite(45).visible = 1
  10.   sprite(46).visible = 1
  11.   sprite(55).visible = 1
  12.   member("Balloon0000").regPoint = point(63, 32)
  13.   member("Balloon0001").regPoint = point(63, 32)
  14.   member("Balloon0002").regPoint = point(63, 32)
  15.   member("Balloon0003").regPoint = point(63, 32)
  16.   member("Balloon0004").regPoint = point(63, 32)
  17.   member("Balloon0005").regPoint = point(63, 32)
  18.   member("Balloon0006").regPoint = point(63, 32)
  19.   member("Balloon0007").regPoint = point(63, 32)
  20.   member("Balloon0008").regPoint = point(63, 32)
  21.   member("Balloon0009").regPoint = point(63, 32)
  22.   g1SecAhead = 0
  23.   secs = 0
  24.   mins = 0
  25.   member("TimeText").text = "Time:" && string(mins) & ":0" & string(secs)
  26.   gShocked = 0
  27.   gLifePoints = 3
  28.   startTimer()
  29. end
  30.  
  31. on getAngle x1, y1, x2, y2
  32.   loc1 = [x1, y1]
  33.   loc2 = [x2, y2]
  34.   deltaX = loc2[1] - loc1[1]
  35.   deltaY = -1 * (loc2[2] - loc1[2])
  36.   if deltaY = 0 then
  37.     if deltaX > 0 then
  38.       return 0
  39.     end if
  40.     if deltaX < 0 then
  41.       return 180
  42.     end if
  43.   end if
  44.   if deltaX = 0 then
  45.     deltaX = 0.01
  46.   end if
  47.   theAngle = atan(float(deltaY) / float(deltaX))
  48.   theAngle = theAngle * 180 / PI
  49.   if (deltaX < 0) and (deltaY > 0) then
  50.     theAngle = 180 + theAngle
  51.   else
  52.     if (deltaX < 0) and (deltaY < 0) then
  53.       theAngle = 180 + theAngle
  54.     else
  55.       if (deltaX > 0) and (deltaY < 0) then
  56.         theAngle = 360 + theAngle
  57.       end if
  58.     end if
  59.   end if
  60.   theAngle = theAngle - 90
  61.   if theAngle < 0 then
  62.     theAngle = 360 + theAngle
  63.   end if
  64.   return theAngle
  65. end
  66.  
  67. on getDistance point1X, point1Y, point2X, point2Y
  68.   distance1 = abs(point1X - point2X)
  69.   distance2 = abs(point1Y - point2Y)
  70.   hypo = sqrt((distance1 * distance1) + (distance2 * distance2))
  71.   return hypo
  72. end
  73.  
  74. on GameTimer
  75.   if the timer > g1SecAhead then
  76.     g1SecAhead = the timer + 60
  77.     secs = the timer / 60 mod 60
  78.     mins = ((the timer / 60) - secs) / 60
  79.     if secs < 10 then
  80.       member("TimeText").text = "Time:" && string(mins) & ":0" & string(secs)
  81.     else
  82.       member("TimeText").text = "Time:" && string(mins) & ":" & string(secs)
  83.     end if
  84.   end if
  85. end
  86.