home *** CD-ROM | disk | FTP | other *** search
- property pCup, spriteNum, pOriginalLoc, pTimeout, pOriginalMember, oLoc, pLocation, pCenterOfRotation, pAngle, pAxisX, pAxisY, eatshit
- global gCup, gCupSprites, gCupsToMove, gPickCup, gBalls, gBallInPlay, gGameEnd, gProceed, gHands, gI, gCenterOfRotation, gAxisX, gAxisY, fuctUp, gMisses
-
- on beginSprite me
- gI = 0
- pCup = sprite(spriteNum)
- pOriginalLoc = pCup.loc
- pCup.visible = 1
- gCupSprites.add(pCup)
- pOriginalMember = pCup.member
- if gCupSprites.count = 2 then
- gCup = sprite(spriteNum)
- end if
- eatshit = 0
- end
-
- on coverBall me
- if not voidp(gBallInPlay) then
- pTimeout = timeout(string(the ticks + spriteNum)).new(5, #moveOverBall, me)
- end if
- end
-
- on moveOverBall me
- if pCup.locV < gBallInPlay.locV then
- if pCup.locV < gBallInPlay.locV then
- pCup.locV = pCup.locV + 5
- end if
- else
- pTimeout.forget()
- gHands[#left].member = member("left")
- pCup.member = pOriginalMember
- pCup.visible = 1
- gBallInPlay.blend = 0
- pTimeout = timeout(string(the ticks + spriteNum)).new(5, #moveBackToOriginalPos, me)
- gBallInPlay.pTimeout = timeout(string(the ticks + gBallInPlay.spriteNum)).new(1, #followCup, gBallInPlay)
- end if
- end
-
- on moveBackToOriginalPos me
- if pCup.loc > pOriginalLoc then
- pCup.locV = pCup.locV - 5
- else
- pTimeout.forget()
- puppetSound(8, member("roll"))
- getTwoRandomCups()
- end if
- end
-
- on fuckYou me, ass
- pAngle = pAngle + getRadians(ass)
- newX = cos(pAngle) * gAxisX
- newY = sin(pAngle) * gAxisY
- pLocation = gCenterOfRotation + [newX, newY]
- pCup.loc = point(pLocation[1], pLocation[2])
- end
-
- on mouseDown me
- if gPickCup then
- gBallInPlay.blend = 100
- gHands[#left].loc = pCup.loc
- pCup.visible = 0
- repeat with i = 1 to 9
- gHands[#left].member = member("arm" & i)
- s = the ticks + 1
- repeat while the ticks < s
- updateStage()
- end repeat
- end repeat
- gPickCup = 0
- if pCup = gCup then
- s = the ticks + 25
- repeat while the ticks < s
- updateStage()
- end repeat
- gBallInPlay.throwOut(#player)
- else
- s = the ticks + 50
- repeat while the ticks < s
- updateStage()
- end repeat
- repeat with i = 9 down to 1
- gHands[#left].member = member("arm" & i)
- s = the ticks + 1
- repeat while the ticks < s
- updateStage()
- end repeat
- end repeat
- pCup.visible = 1
- gCup.visible = 0
- gHands[#left].member = member("left")
- gHands[#left].loc = gCup.loc
- repeat with i = 1 to 9
- gHands[#left].member = member("arm" & i)
- s = the ticks + 1
- repeat while the ticks < s
- updateStage()
- end repeat
- end repeat
- gBallInPlay.throwOut(#dealer)
- end if
- repeat with i in gCupSprites
- i.loc = i.pOriginalLoc
- if gCupSprites.findPos(i) <> 2 then
- i.member = i.pOriginalMember
- end if
- end repeat
- if gMisses < 3 then
- fuctUp.visible = 1
- gProceed = 1
- end if
- end if
- end
-
- on showABall me
- pTimeout.forget()
- gCup.locV = gCup.locV - 25
- gCup.member = member("cup down")
- gBallInPlay.throwOut(#dealer)
- end
-
- on gameOver me
- gGameEnd.forget()
- go("game over")
- end
-