Hi,
I have an issue with displaying a group of sprites. I need to put a group of objects on the map and, after create them, I need move each one independently from others.
It seems that the setting kind = “group” considers the group as a single sprite then the command “moveSpriteTo” works on the entire group, so for my needs I can not use it.
The following code has some problems: correctly adds the sprites on the map but does not inserts the elements in the table “parts”.
local locX=44 local locY=29 local pieces = 5 for i = 1, npieces do local setup = {layer = 3, kind = "sprite", locX = locX - i \* 0.5, locY = locY, levelWidth = 16, levelHeight = 16} local parte = display.newImage("ball.png", 16, 16) parts.insert(parts, parte) -- statement 1 mte.addSprite(parte, setup) -- statement 2 end
If I swap the two statements (1 and 2), however , the table is ok but inserts a single sprite instance on the map .
Any suggestions?
Thanks in advance.
-jospic