home *** CD-ROM | disk | FTP | other *** search
- property pBall, spriteNum, pOriginalLoc, pTimeout
- global gBalls, gBallInPlay, gCup, gButton, gHands, gCountaWhat, gSpinCup, gMisses
-
- on beginSprite me
- pBall = sprite(spriteNum)
- pBall.visible = 1
- pOriginalLoc = pBall.loc
- gBalls.add(pBall)
- end
-
- on putIntoPlay me
- gBallInPlay = sprite(spriteNum)
- gBallInPlay.loc = point((the stage).rect.width / 2, ((the stage).rect.height / 2) + 100)
- gHands[#left].pushCup()
- end
-
- on throwOut me, who
- pTimeout.forget()
- if who = #player then
- y9 = float(gButton[who].locV) - float(pBall.locV)
- x9 = float(gButton[who].locH) - float(pBall.locH)
- pLocation = [float(pBall.locH), float(pBall.locV)]
- theAng = atan(abs(y9 / x9))
- put theAng
- repeat while pBall.loc <> gButton[who].loc
- xPos = -cos(theAng) * 1.0
- yPos = sin(theAng) * 1.0
- if yPos < 0 then
- yPos = -yPos
- end if
- pLocation = pLocation + [xPos, yPos]
- pBall.loc = point(pLocation[1], pLocation[2])
- updateStage()
- end repeat
- gCup.visible = 1
- gHands[#left].member = member("left")
- gHands[#left].loc = gHands[#left].pOriginalLoc
- xtc = value(member(string(who) && "score").text)
- puppetSound(4, member("right bowl"))
- member(string(who) && "score").text = string(xtc + (5 * gCountaWhat))
- pBall.loc = point(-100, -100)
- else
- y9 = float(gSpinCup[gMisses + 1].locV) - float(pBall.locV)
- x9 = float(gSpinCup[gMisses + 1].locH) - float(pBall.locH)
- pLocation = [float(pBall.locH), float(pBall.locV)]
- theAng = atan(abs(y9 / x9))
- repeat while pBall.loc <> gSpinCup[gMisses + 1].loc
- xPos = cos(theAng) * 1.0
- yPos = -sin(theAng) * 1.0
- if yPos < 0 then
- yPos = -yPos
- end if
- pLocation = pLocation + [xPos, yPos]
- pBall.loc = point(pLocation[1], pLocation[2])
- updateStage()
- end repeat
- gMisses = gMisses + 1
- puppetSound(4, member("wrong bowl"))
- gSpinCup[gMisses].krazyKool()
- gCup.visible = 1
- gHands[#left].member = member("left")
- gHands[#left].loc = gHands[#left].pOriginalLoc
- pBall.loc = point(-100, -100)
- end if
- end
-
- on followCup me
- pBall.loc = gCup.loc
- end
-