home *** CD-ROM | disk | FTP | other *** search
- property pTimer
- global gObjectList, gLives, gScore
-
- on new
- gObjectList = []
- pTimer = the ticks
- sendSprite(27, #setGameOver)
- sendSprite(28, #setGameOver)
- sendSprite(29, #setGameOver)
- end
-
- on exitFrame me
- objectDropSpeed = 90 - (gScore / 30)
- if objectDropSpeed < 45 then
- objectDropSpeed = 45
- end if
- if ((pTimer + objectDropSpeed) < the ticks) and (random(2) = 1) then
- pTimer = the ticks
- aChannel = 100
- found = 0
- repeat while found = 0
- if sprite(aChannel).puppet = 1 then
- aChannel = aChannel + 1
- next repeat
- end if
- found = 1
- end repeat
- theSpeed = 3 + (gScore / 300)
- if theSpeed > 15 then
- theSpeed = 15
- end if
- if random(5) = 1 then
- append(gObjectList, new(script("Object"), point(sprite(random(3) + 24).locH, -10), theSpeed, 0, "poison", aChannel))
- else
- append(gObjectList, new(script("Object"), point(sprite(random(3) + 24).locH, -10), theSpeed, 1, "Fruit", aChannel))
- end if
- end if
- repeat with counter = 1 to count(gObjectList)
- gObjectList[counter].updateObject()
- end repeat
- checkIfObjectsAreGone()
- go(the frame)
- end
-
- on checkIfObjectsAreGone
- repeat with counter = 1 to count(gObjectList)
- if gObjectList[counter].pObjectPosition[2] > 470 then
- if gObjectList[counter].pGoodObject then
- gLives = gLives - 1
- puppetSound(6, "wrongguess")
- if gLives < 0 then
- puppetSound(4, "loser")
- go(19)
- exit
- end if
- member("gLives").text = string(gLives)
- end if
- gObjectList[counter].killObject()
- deleteAt(gObjectList, counter)
- end if
- end repeat
- end
-