home *** CD-ROM | disk | FTP | other *** search
Wrap
property pHiding, pEating, pEatCounter, pHit, pHitCounter, spriteNum, pFrameNum, pFrameTimer, pGameOver global gObjectList, gScore, gLives on beginSprite me pFrameTimer = the ticks pFrameNum = 1 gObjectList = [] pHiding = 0 pEating = 0 pHit = 0 pHitCounter = 0 pEatCounter = 0 pGameOver = 0 sprite(spriteNum).member = "Normal1" end on mouseUp me puppetSound(1, "click bird") if pHiding = 1 then if (pHit = 0) and (pEating = 0) then sprite(spriteNum).member = "Normal1" pHiding = 0 end if else if (pHit = 0) and (pEating = 0) then sprite(spriteNum).member = "Hiding" pHiding = 1 end if end if end on exitFrame me if the frame > 15 then exit end if if ((pFrameTimer + 12) < the ticks) and (pHiding = 0) and (pHit = 0) and (pEating = 0) then pFrameTimer = the ticks pFrameNum = pFrameNum + 1 if pFrameNum > 2 then pFrameNum = 1 end if sprite(spriteNum).member = "Normal" & string(pFrameNum) end if if (pHit = 0) and (pEating = 0) then checkColision(spriteNum) end if if pHit = 1 then monkeyHit() end if if pEating = 1 then monkeyEating() end if end on monkeyHit pHitCounter = pHitCounter + 1 case spriteNum of 25: sprite(45).rotation = sprite(45).rotation + 30 sprite(46).rotation = sprite(46).rotation + 30 26: sprite(47).rotation = sprite(47).rotation + 30 sprite(48).rotation = sprite(48).rotation + 30 27: sprite(49).rotation = sprite(49).rotation + 30 sprite(50).rotation = sprite(50).rotation + 30 end case if pHitCounter > 21 then case spriteNum of 25: sprite(45).blend = 0 sprite(46).blend = 0 26: sprite(47).blend = 0 sprite(48).blend = 0 27: sprite(49).blend = 0 sprite(50).blend = 0 end case case spriteNum of 25: repeat with anotherCounter = 200 to 203 sprite(anotherCounter).blend = 0 end repeat 26: repeat with anotherCounter = 205 to 208 sprite(anotherCounter).blend = 0 end repeat 27: repeat with anotherCounter = 210 to 213 sprite(anotherCounter).blend = 0 end repeat end case sprite(spriteNum + 4).loc = point(800, 800) pHit = 0 sprite(spriteNum).member = "Normal1" if gLives < 0 then puppetSound(4, "loser") go(19) end if end if end on monkeyEating pEatCounter = pEatCounter + 1 if pEatCounter > 10 then pEating = 0 sprite(spriteNum).member = "Normal1" end if end on checkColision theSprite repeat with counter = 1 to count(gObjectList) if sprite(theSprite).intersects(gObjectList[counter].pChannel) and (pHiding = 0) and (gObjectList[counter].pObjectPosition[2] < 364) and (gObjectList[counter].pObjectPosition[2] > 240) then if gObjectList[counter].pGoodObject then puppetSound(2, "eat worm") pEating = 1 pEatCounter = 0 sprite(spriteNum).member = "MonkeyEating" gScore = gScore + 10 member("gScore").text = string(gScore) else puppetSound(2, "hitbirdsound") case spriteNum of 25: sprite(45).blend = 100 sprite(46).blend = 100 26: sprite(47).blend = 100 sprite(48).blend = 100 27: sprite(49).blend = 100 sprite(50).blend = 100 end case sprite(spriteNum + 4).loc = sprite(spriteNum).loc case spriteNum of 25: repeat with anotherCounter = 200 to 203 sprite(anotherCounter).blend = 100 end repeat 26: repeat with anotherCounter = 205 to 208 sprite(anotherCounter).blend = 100 end repeat 27: repeat with anotherCounter = 210 to 213 sprite(anotherCounter).blend = 100 end repeat end case pHit = 1 pHitCounter = 0 sprite(spriteNum).member = "hitbird" gLives = gLives - 1 if gLives >= 0 then member("gLives").text = string(gLives) end if repeat with counter911 = 200 to 213 sendSprite(counter911, #reset) end repeat end if gObjectList[counter].killObject() deleteAt(gObjectList, counter) end if end repeat end on setGameOver pGameOver = 0 end