home *** CD-ROM | disk | FTP | other *** search
- global gLevel, gShocked, gLifePoints, g1SecAhead, secs, mins, gPaused
-
- on startMovie
- cursor(200)
- gPaused = 0
- sound(5).volume = 30
- puppetSound(5, "fan_wind2")
- sprite(44).visible = 1
- sprite(45).visible = 1
- sprite(46).visible = 1
- sprite(55).visible = 1
- member("Balloon0000").regPoint = point(63, 32)
- member("Balloon0001").regPoint = point(63, 32)
- member("Balloon0002").regPoint = point(63, 32)
- member("Balloon0003").regPoint = point(63, 32)
- member("Balloon0004").regPoint = point(63, 32)
- member("Balloon0005").regPoint = point(63, 32)
- member("Balloon0006").regPoint = point(63, 32)
- member("Balloon0007").regPoint = point(63, 32)
- member("Balloon0008").regPoint = point(63, 32)
- member("Balloon0009").regPoint = point(63, 32)
- g1SecAhead = 0
- secs = 0
- mins = 0
- member("TimeText").text = "Time:" && string(mins) & ":0" & string(secs)
- gShocked = 0
- gLifePoints = 3
- startTimer()
- end
-
- on getAngle x1, y1, x2, y2
- loc1 = [x1, y1]
- loc2 = [x2, y2]
- deltaX = loc2[1] - loc1[1]
- deltaY = -1 * (loc2[2] - loc1[2])
- if deltaY = 0 then
- if deltaX > 0 then
- return 0
- end if
- if deltaX < 0 then
- return 180
- end if
- end if
- if deltaX = 0 then
- deltaX = 0.01
- end if
- theAngle = atan(float(deltaY) / float(deltaX))
- theAngle = theAngle * 180 / PI
- if (deltaX < 0) and (deltaY > 0) then
- theAngle = 180 + theAngle
- else
- if (deltaX < 0) and (deltaY < 0) then
- theAngle = 180 + theAngle
- else
- if (deltaX > 0) and (deltaY < 0) then
- theAngle = 360 + theAngle
- end if
- end if
- end if
- theAngle = theAngle - 90
- if theAngle < 0 then
- theAngle = 360 + theAngle
- end if
- return theAngle
- end
-
- on getDistance point1X, point1Y, point2X, point2Y
- distance1 = abs(point1X - point2X)
- distance2 = abs(point1Y - point2Y)
- hypo = sqrt((distance1 * distance1) + (distance2 * distance2))
- return hypo
- end
-
- on GameTimer
- if the timer > g1SecAhead then
- g1SecAhead = the timer + 60
- secs = the timer / 60 mod 60
- mins = ((the timer / 60) - secs) / 60
- if secs < 10 then
- member("TimeText").text = "Time:" && string(mins) & ":0" & string(secs)
- else
- member("TimeText").text = "Time:" && string(mins) & ":" & string(secs)
- end if
- end if
- end
-