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

  1. global gPattern, gFishCaught, gSpriteCaught, gFishFollowingBait, gPlayOnce, gNumFishCaught, gScore, gRemaindingTime, pLaunchHook
  2.  
  3. on prepareMovie
  4.   gNumFishCaught = 0
  5.   member("FishesDisplay").text = "0"
  6.   member("ScoreDisplay").text = "0"
  7.   gPlayOnce = 1
  8.   gFishFollowingBait = 0
  9.   gFishCaught = 0
  10.   gPattern = [point(92, 74), point(13, 34), point(13, 77), point(15, 87), point(18, 97), point(24, 106), point(29, 112), point(38, 119), point(54, 128), point(74, 134), point(98, 137), point(149, 137), point(167, 134), point(188, 130), point(99, 25), point(75, 10), point(28, 3), point(218, 3), point(230, 5), point(235, 8), point(215, 56), point(212, 72), point(217, 96), point(227, 109), point(232, 116), point(233, 127), point(232, 145), point(226, 148), point(216, 150), point(198, 145), point(178, 128), point(167, 123), point(149, 119), point(130, 119), point(116, 121), point(106, 124), point(98, 130), point(80, 141), point(46, 140), point(38, 134), point(34, 124), point(36, 114), point(42, 108), point(61, 103), point(198, 52), point(205, 46), point(210, 35), point(206, 14), point(202, 10), point(195, 7), point(149, 6), point(89, 10), point(50, 20), point(35, 32), point(30, 38), point(22, 49), point(20, 81), point(30, 99), point(72, 117), point(143, 109), point(184, 98), point(205, 69), point(215, 29), point(210, 21), point(200, 16), point(164, 14), point(136, 16), point(118, 20), point(105, 29), point(92, 61), point(89, 49), point(110, 76), point(145, 91), point(174, 143), point(4, 13), point(232, 73)]
  11.   gRemaindingTime = 120
  12.   displayTime()
  13. end
  14.  
  15. on getAngle loc1, loc2
  16.   deltaX = loc2[1] - loc1[1]
  17.   deltaY = -1 * (loc2[2] - loc1[2])
  18.   if deltaY = 0 then
  19.     if deltaX > 0 then
  20.       return 0
  21.     end if
  22.     if deltaX < 0 then
  23.       return 180
  24.     end if
  25.   end if
  26.   if deltaX = 0 then
  27.     deltaX = 0.01
  28.   end if
  29.   theAngle = atan(float(deltaY) / float(deltaX))
  30.   theAngle = theAngle * 180 / PI
  31.   if (deltaX < 0) and (deltaY > 0) then
  32.     theAngle = 180 + theAngle
  33.   else
  34.     if (deltaX < 0) and (deltaY < 0) then
  35.       theAngle = 180 + theAngle
  36.     else
  37.       if (deltaX > 0) and (deltaY < 0) then
  38.         theAngle = 360 + theAngle
  39.       end if
  40.     end if
  41.   end if
  42.   theAngle = theAngle - 90
  43.   if theAngle < 0 then
  44.     theAngle = 360 + theAngle
  45.   end if
  46.   return theAngle
  47. end
  48.  
  49. on getDistance point1, point2
  50.   point1X = point1[1]
  51.   point1Y = point1[2]
  52.   point2X = point2[1]
  53.   point2Y = point2[2]
  54.   distance1 = float(abs(point1X - point2X))
  55.   distance2 = float(abs(point1Y - point2Y))
  56.   hypo = sqrt((distance1 * distance1) + (distance2 * distance2))
  57.   return hypo
  58. end
  59.  
  60. on displayTime
  61.   if (gRemaindingTime / 60) < 10 then
  62.     timeCount = "0" & string(integer(gRemaindingTime / 60))
  63.   else
  64.     timeCount = string(integer(gRemaindingTime / 60))
  65.   end if
  66.   if (gRemaindingTime mod 60) < 10 then
  67.     timeCount = timeCount && ":" && "0" & string(gRemaindingTime mod 60)
  68.   else
  69.     timeCount = timeCount && ":" && string(gRemaindingTime mod 60)
  70.   end if
  71.   member("GameTime").text = timeCount
  72. end
  73.