home *** CD-ROM | disk | FTP | other *** search
- property spriteNum, pAngle, pPowerMeter, pMaxPower, pSpace, pSpaceStart, pHookDistance, pHookInWater, theAngle, holdTime, pHookLaunchSpeed, pReelOnce
- global gNumFishCaught, gScore, gFishCaught, gSpriteCaught, gFishFollowingBait, gPlayOnce, pLaunchHook
-
- on beginSprite me
- gPlayOnce = 1
- pReelOnce = 1
- pHookInWater = 0
- pHookDistance = 0
- pLaunchHook = 0
- pSpace = 0
- pSpaceStart = 0
- pMaxPower = 147
- sprite(25).blend = 100
- sprite(25).loc = point(800, 800)
- end
-
- on exitFrame
- if sprite(35).locH < 800 then
- sprite(35).width = sprite(35).width + 1
- sprite(35).blend = sprite(35).blend - 5
- if sprite(35).blend < 10 then
- sprite(35).loc = point(900, 900)
- sprite(35).blend = 100
- sprite(35).width = 104
- end if
- end if
- if pHookInWater = 1 then
- sprite(8).locH = sprite(8).locH - 10
- if sprite(8).locH < 404 then
- sprite(8).locH = 404
- end if
- sprite(7).width = sprite(7).width - 10
- if sprite(7).width < 0 then
- sprite(7).width = 0
- end if
- end if
- if (the rightMouseDown = 1) and (pHookInWater = 1) then
- if the frame > 1 then
- exit
- end if
- if pReelOnce = 1 then
- puppetSound(2, "reel_in")
- pReelOnce = 0
- end if
- railInHook()
- sprite(25).rotation = sprite(25).rotation + 10
- if sprite(25).rotation > 120 then
- sprite(25).rotation = 120
- end if
- else
- if soundBusy(2) then
- sound(2).stop()
- pReelOnce = 1
- end if
- if (sprite(25).locV > 0) and (sprite(25).locH > 0) and (sprite(25).locH < 600) then
- if gFishCaught = 1 then
- sprite(25).loc = point(sprite(25).locH - (float(sin(theAngle * 3.14000000000000012 / 180.0)) * 1), sprite(25).locV - (float(cos(theAngle * 3.14000000000000012 / 180.0)) * 1))
- end if
- end if
- sprite(25).rotation = sprite(25).rotation - 5
- if sprite(25).rotation < 0 then
- sprite(25).rotation = 0
- end if
- end if
- if pLaunchHook = 0 then
- if pHookInWater = 1 then
- exit
- end if
- if the frame > 1 then
- exit
- end if
- if mouseV() < 350 then
- pAngle = getAngle(point(sprite(spriteNum).locH, sprite(spriteNum).locV), point(mouseH(), mouseV()))
- sprite(spriteNum).rotation = 360 - pAngle
- end if
- checkInput()
- else
- doHookLaunch()
- end if
- end
-
- on checkInput
- if the frame > 1 then
- exit
- end if
- if (the mouseDown = 1) and (pSpace = 0) then
- if pHookInWater = 1 then
- exit
- end if
- pSpace = 1
- pSpaceStart = the ticks
- end if
- if the mouseDown = 1 then
- if pHookInWater = 1 then
- exit
- end if
- holdTime = (the ticks - pSpaceStart) / 3
- if holdTime > 15 then
- holdTime = 15
- end if
- sprite(8).locH = (holdTime * 147 / 15) + 404
- sprite(7).width = holdTime * 147 / 15
- end if
- if (the mouseDown = 0) and (pSpace = 1) then
- if pHookInWater = 1 then
- exit
- end if
- theAngle = 360 - sprite(spriteNum).rotation
- sprite(25).loc = point(sprite(spriteNum).locH - (float(sin(theAngle * 3.14000000000000012 / 180.0)) * 60), sprite(spriteNum).locV - (float(cos(theAngle * 3.14000000000000012 / 180.0)) * 60))
- pSpace = 0
- holdTime = (the ticks - pSpaceStart) / 3
- if holdTime > 15 then
- holdTime = 15
- end if
- if holdTime < 4 then
- holdTime = 4
- end if
- pHookDistance = holdTime * 24
- sprite(spriteNum).member = "fisherman2"
- pLaunchHook = 1
- gFishFollowingBait = 0
- sprite(25).blend = 100
- pHookLaunchSpeed = (holdTime / 2) + 3
- end if
- end
-
- on railInHook
- if gFishCaught = 1 then
- sprite(spriteNum).member = "fisherman3"
- factor = random(4) - 2
- else
- factor = 3
- end if
- sprite(25).loc = point(sprite(25).locH + (float(sin(theAngle * 3.14000000000000012 / 180.0)) * factor), sprite(25).locV + (float(cos(theAngle * 3.14000000000000012 / 180.0)) * factor))
- if sprite(25).locV > 350 then
- gPlayOnce = 1
- if gFishCaught = 1 then
- gNumFishCaught = gNumFishCaught + 1
- gScore = gScore + 10
- member("FishesDisplay").text = string(gNumFishCaught)
- member("ScoreDisplay").text = string(gScore)
- puppetSound(3, "catchfish")
- sprite(spriteNum).member = "hasFish"
- sprite(25).loc = point(800, 800)
- sprite(25).blend = 100
- pLauchHook = 0
- pHookInWater = 0
- sprite(gSpriteCaught).loc = point(800, 800)
- sprite(gSpriteCaught).blend = 0
- else
- sprite(25).loc = point(800, 800)
- pLauchHook = 0
- pHookInWater = 0
- sprite(spriteNum).member = "fisherman1"
- end if
- end if
- end
-
- on doHookLaunch
- sprite(25).loc = point(sprite(25).locH - (float(sin(theAngle * 3.14000000000000012 / 180.0)) * pHookLaunchSpeed), sprite(25).locV - (float(cos(theAngle * 3.14000000000000012 / 180.0)) * pHookLaunchSpeed))
- pHookDistance = pHookDistance - pHookLaunchSpeed
- pHookInWater = 1
- if gPlayOnce = 1 then
- puppetSound(1, "cast")
- gPlayOnce = 0
- end if
- if pHookDistance <= 0 then
- pHookLaunchSpeed = pHookLaunchSpeed - 0.5
- if pHookLaunchSpeed <= 0 then
- pLaunchHook = 0
- sprite(25).blend = 20
- sprite(35).loc = sprite(25).loc
- puppetSound(5, "watersplash")
- end if
- end if
- end
-