home *** CD-ROM | disk | FTP | other *** search
/ GQ - Louise, World Cup, …remy Clarkson, Armageddon / GQCD.iso / files / menu.dxr / 00002_spriteGenerator.ls < prev    next >
Encoding:
Text File  |  1998-05-21  |  861 b   |  41 lines

  1. property spriteNum
  2.  
  3. on new me
  4.   return me
  5. end
  6.  
  7. on appear me, myPos, myMember, myColour, mySpriteNum, myInk
  8.   if mySpriteNum = 0 then
  9.     set spriteNum to findSpace(me)
  10.   else
  11.     set spriteNum to mySpriteNum
  12.   end if
  13.   if spriteNum > 0 then
  14.     puppetSprite(spriteNum, 1)
  15.     set the foreColor of sprite spriteNum to 255
  16.     set the ink of sprite spriteNum to myInk
  17.     set the loc of sprite spriteNum to myPos
  18.     set the memberNum of sprite spriteNum to member myMember
  19.     set the foreColor of sprite spriteNum to myColour
  20.   else
  21.     abort()
  22.   end if
  23. end
  24.  
  25. on findSpace me
  26.   repeat with x = 1 to 48
  27.     if the memberNum of sprite x = 0 then
  28.       return x
  29.       exit repeat
  30.     end if
  31.   end repeat
  32.   return 0
  33. end
  34.  
  35. on destroy me
  36.   set the memberNum of sprite spriteNum to 0
  37.   set pos to getPos(the actorList, me)
  38.   deleteAt(the actorList, pos)
  39.   return me
  40. end
  41.