home *** CD-ROM | disk | FTP | other *** search
- property pSpider, spriteNum, pTimeout, pDirection, pRotInc, pRotDif
-
- on beginSprite me
- pSpider = sprite(spriteNum)
- pDirection = 1
- pTimeout = timeout("spider").new(25, #crawl, me)
- end
-
- on crawl me
- pSpider.locV = pSpider.locV + pDirection
- if (pSpider.locV > ((the stage).rect.height + pSpider.height)) or (pSpider.locV < (0 - pSpider.height)) then
- pDirection = pDirection * -1
- the randomSeed = the ticks
- pSpider.locH = random((the stage).rect.width)
- pSpider.flipV = not pSpider.flipV
- if pSpider.locV > (the stage).rect.height then
- pSpider.locV = (the stage).rect.height - 10
- else
- pSpider.locV = 0 + 10
- end if
- end if
- end
-