home *** CD-ROM | disk | FTP | other *** search
- property pPositionX, pPositionY, pDestPositionX, pDestPositionY, pDestDistance, pDistance, pSpeed, pBType, pChannel, pState, pAngle, pStupidIncrement, pTheStupidKid
- global gPath, gPlayer3, gEnemy1, gEnemy2, gEnemy3, gTotalScore, gTotalHealth, gFlagSeised, doChopper
-
- on new me, posX, posY, aDistance, speed, bType, channel, theStupidKid, destPositionX, destPositionY
- puppetSound(3, "laser")
- pPositionX = posX
- pPositionY = posY
- pDestDistance = aDistance
- pTheStupidKid = theStupidKid
- if bType = 1 then
- pSpeed = 10
- else
- pSpeed = 5
- end if
- pBType = bType
- pChannel = channel
- if voidp(destPositionX) then
- pAngle = 360 - gPlayer3.pCannonAngle
- else
- pDestPositionX = destPositionX
- pDestPositionY = destPositionY
- pAngle = comeGetSome(pPositionX, pPositionY, pDestPositionX, pDestPositionY)
- end if
- pState = 1
- pDistance = 0
- pStupidIncrement = 0
- sprite(channel).puppet = 1
- sprite(channel).member = "snowBall1"
- sprite(channel).backColor = 6
- sprite(channel).ink = 36
- sprite(channel).loc = point(pPositionX, pPositionY)
- theRotation = 360 - pAngle
- sprite(channel).rotation = theRotation
- pPositionX = pPositionX - (float(sin(pAngle * 3.14000000000000012 / 180)) * pSpeed)
- pPositionY = pPositionY - (float(cos(pAngle * 3.14000000000000012 / 180)) * pSpeed)
- pPositionX = pPositionX - (float(sin(pAngle * 3.14000000000000012 / 180)) * pSpeed)
- pPositionY = pPositionY - (float(cos(pAngle * 3.14000000000000012 / 180)) * pSpeed)
- sprite(channel).loc = point(pPositionX, pPositionY)
- return me
- end
-
- on getAngle me
- return pAngle
- end
-
- on updateBomb me
- case pState of
- 1:
- moveBomb()
- 2:
- fadeBomb()
- 3:
- end case
- end
-
- on getChannel me
- return pChannel
- end
-
- on moveBomb me
- if sprite(pChannel).intersects(52) and not (pTheStupidKid = 52) then
- if not (gPlayer3.pState = 6) then
- puppetSound(2, "impact")
- if gPlayer3.pIsHoldingObject = 1 then
- gFlagSeised = 0
- gPlayer3.pIsHoldingObject = 0
- if doChopper = 0 then
- sprite(20).loc = point(197, 65)
- end if
- end if
- gPlayer3.pState = 6
- gPlayer3.pStundTime = the ticks
- sprite(68).loc = sprite(52).loc
- sprite(68).rotation = sprite(52).rotation
- pState = 2
- end if
- else
- if sprite(pChannel).intersects(54) and not (pTheStupidKid = 54) then
- if not (gEnemy1.stundTime < 120) then
- sprite(69).loc = sprite(54).loc
- sprite(69).rotation = sprite(54).rotation
- if gEnemy1.pHoldingFlag = 1 then
- puppetSound(2, "impact")
- gFlagSeised = 0
- gEnemy1.pHoldingFlag = 0
- if doChopper = 0 then
- sprite(20).loc = point(197, 65)
- end if
- end if
- gEnemy1.stundTime = 0
- pState = 2
- end if
- else
- if sprite(pChannel).intersects(55) and not (pTheStupidKid = 55) then
- if not (gEnemy2.stundTime < 120) then
- sprite(70).loc = sprite(55).loc
- sprite(70).rotation = sprite(55).rotation
- if gEnemy2.pHoldingFlag = 1 then
- puppetSound(2, "impact")
- gFlagSeised = 0
- gEnemy2.pHoldingFlag = 0
- if doChopper = 0 then
- sprite(20).loc = point(197, 65)
- end if
- end if
- gEnemy2.stundTime = 0
- pState = 2
- end if
- else
- if sprite(pChannel).intersects(56) and not (pTheStupidKid = 56) then
- if not (gEnemy3.stundTime < 120) then
- sprite(71).loc = sprite(56).loc
- sprite(71).rotation = sprite(56).rotation
- if gEnemy3.pHoldingFlag = 1 then
- puppetSound(2, "impact")
- gFlagSeised = 0
- gEnemy3.pHoldingFlag = 0
- if doChopper = 0 then
- sprite(20).loc = point(197, 65)
- end if
- end if
- gEnemy3.stundTime = 0
- pState = 2
- end if
- end if
- end if
- end if
- end if
- pPositionX = pPositionX - (float(sin(pAngle * 3.14000000000000012 / 180)) * pSpeed)
- pPositionY = pPositionY - (float(cos(pAngle * 3.14000000000000012 / 180)) * pSpeed)
- addparticle(point(pPositionX + (float(sin(pAngle * 3.14000000000000012 / 180)) * pSpeed), pPositionY + (float(cos(pAngle * 3.14000000000000012 / 180)) * pSpeed)), 360 - pAngle)
- sprite(pChannel).loc = point(pPositionX, pPositionY)
- pDistance = pDistance + pSpeed
- if pDistance > pDestDistance then
- pState = 2
- end if
- end
-
- on fadeBomb me
- pState = 3
- sprite(pChannel).puppet = 0
- end
-
- on comeGetSome 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
-