Storing a single sprite in multiple tables?

Due to my lack of understanding and knowledge I thought this would work but it doesn’t.

I have 4 sprites that I wish to store in 4 different tables. I was thinking the sprite would physically be in the table and I could name it etc… but it seems to be pointing to the sprite and anything I do like changing the name, actually changes the name on the sprite and hence the name in all the other tables.

spriteOne[1] = redFlower spriteOne[2] = purpleSpiderWeb spriteOne[3] = brownSpider spriteOne[4] = greenSnake spriteOne[1].name = "1" spriteOne[2].name = "1" spriteOne[3].name = "1" spriteOne[4].name = "1"   print("sprite One:" .. spriteOne[1].name) --prints 1   spriteTwo[1] = redFlower spriteTwo[2] = purpleSpiderWeb spriteTwo[3] = brownSpider spriteTwo[4] = greenSnake spriteTwo[1].name = "2" spriteTwo[2].name = "2" spriteTwo[3].name = "2" spriteTwo[4].name = "2"   print("sprite One:" .. spriteOne[1].name) --prints 2   spriteThree[1] = redFlower spriteThree[2] = purpleSpiderWeb spriteThree[3] = brownSpider spriteThree[4] = greenSnake spriteThree[1].name = "3" spriteThree[2].name = "3" spriteThree[3].name = "3" spriteThree[4].name = "3"   print("sprite One:" .. spriteOne[1].name) --prints 3   spriteFour[1] = redFlower spriteFour[2] = purpleSpiderWeb spriteFour[3] = brownSpider spriteFour[4] = greenSnake spriteFour[1].name = "4" spriteFour[2].name = "4" spriteFour[3].name = "4" spriteFour[4].name = "4"   print("sprite One:" .. spriteOne[1].name) --prints 4  

So now am presuming I need 16 separate sprites and can’t shortcut by having just 4.

Dave

try it this way,and this will get you what you are wanting.

spriteOne[1] = {} spriteOne[2] = {} spriteOne[3] = {} spriteOne[4] = {} spriteOne[1].img = redFlower spriteOne[2].img = purpleSpiderWeb spriteOne[3].img = brownSpider spriteOne[4].img = greenSnake spriteOne[1].name = "1" spriteOne[2].name = "1" spriteOne[3].name = "1" spriteOne[4].name = "1" print("sprite One:" .. spriteOne[1].name) spriteTwo[1] = {} spriteTwo[2] = {} spriteTwo[3] = {} spriteTwo[4] = {} spriteTwo[1].img = redFlower spriteTwo[2].img = purpleSpiderWeb spriteTwo[3].img = brownSpider spriteTwo[4].img = greenSnake spriteTwo[1].name = "2" spriteTwo[2].name = "2" spriteTwo[3].name = "2" spriteTwo[4].name = "2" print("sprite One:" .. spriteOne[1].name)

good luck

try it this way,and this will get you what you are wanting.

spriteOne[1] = {} spriteOne[2] = {} spriteOne[3] = {} spriteOne[4] = {} spriteOne[1].img = redFlower spriteOne[2].img = purpleSpiderWeb spriteOne[3].img = brownSpider spriteOne[4].img = greenSnake spriteOne[1].name = "1" spriteOne[2].name = "1" spriteOne[3].name = "1" spriteOne[4].name = "1" print("sprite One:" .. spriteOne[1].name) spriteTwo[1] = {} spriteTwo[2] = {} spriteTwo[3] = {} spriteTwo[4] = {} spriteTwo[1].img = redFlower spriteTwo[2].img = purpleSpiderWeb spriteTwo[3].img = brownSpider spriteTwo[4].img = greenSnake spriteTwo[1].name = "2" spriteTwo[2].name = "2" spriteTwo[3].name = "2" spriteTwo[4].name = "2" print("sprite One:" .. spriteOne[1].name)

good luck