home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / Stonewall.dxr / Internal_17_spidey.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  670 b   |  23 lines

  1. property pSpider, spriteNum, pTimeout, pDirection, pRotInc, pRotDif
  2.  
  3. on beginSprite me
  4.   pSpider = sprite(spriteNum)
  5.   pDirection = 1
  6.   pTimeout = timeout("spider").new(25, #crawl, me)
  7. end
  8.  
  9. on crawl me
  10.   pSpider.locV = pSpider.locV + pDirection
  11.   if (pSpider.locV > ((the stage).rect.height + pSpider.height)) or (pSpider.locV < (0 - pSpider.height)) then
  12.     pDirection = pDirection * -1
  13.     the randomSeed = the ticks
  14.     pSpider.locH = random((the stage).rect.width)
  15.     pSpider.flipV = not pSpider.flipV
  16.     if pSpider.locV > (the stage).rect.height then
  17.       pSpider.locV = (the stage).rect.height - 10
  18.     else
  19.       pSpider.locV = 0 + 10
  20.     end if
  21.   end if
  22. end
  23.