home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / WormFeast.dxr / 00011_Object.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  964 b   |  37 lines

  1. property pObjectSpeed, pObjectPosition, pVelocity, pGoodObject, pChannel, pSpriteName, pFrame, pFrameTimer
  2.  
  3. on new me, thePosition, theVelocity, goodObject, theName, theChannel
  4.   pFrame = 1
  5.   pFrameTimer = the ticks
  6.   pSpriteName = theName
  7.   pGoodObject = goodObject
  8.   pVelocity = theVelocity
  9.   pObjectPosition = thePosition
  10.   pChannel = theChannel
  11.   sprite(pChannel).puppet = 1
  12.   sprite(pChannel).member = string(pSpriteName) & "1"
  13.   sprite(pChannel).loc = pObjectPosition
  14.   sprite(pChannel).ink = 36
  15.   return me
  16. end
  17.  
  18. on updateObject me
  19.   if (pFrameTimer + 8) < the ticks then
  20.     pFrameTimer = the ticks
  21.     pFrame = pFrame + 1
  22.     if pFrame > 2 then
  23.       pFrame = 1
  24.     end if
  25.     sprite(pChannel).member = string(pSpriteName) & string(pFrame)
  26.   end if
  27.   if sprite(pChannel).puppet = 0 then
  28.     exit
  29.   end if
  30.   pObjectPosition[2] = pObjectPosition[2] + pVelocity
  31.   sprite(pChannel).loc = pObjectPosition
  32. end
  33.  
  34. on killObject me
  35.   sprite(pChannel).puppet = 0
  36. end
  37.