Hi, I'm new to Gideros, programming and making apps and I have a question.
I have many sprites of the same classes and a timer modifies their propertyes depending from other sprites, so it would be useful an array of sprites..it's possible?
For example:
local sprite[1][1]=myclass.new("image1.png")
...
local sprite[j][k]=myclass.new("image5.png")
stage:addChild(sprite[1][1])
...
stage:addChild(sprite[j][k])
**...onTimer
for every sprite setimage of sprite[j][k]=getimage of sprite [k][j] (it's only an example)**
Could someone give me some help?
Thank you!
P.S. Sorry for bad english and for lexical imprecision.
Comments
should be:
local sprite = {}
sprite[i]=myclass.new("image1.png")
2dArray={}
for i=1,9 do
2dArray[i]={}
for j=1,9 do
2dArray[i][j]=myclass.new("image"..i..j..".png")
end
end
Fragmenter - animated loop machine and IKONOMIKON - the memory game
http://www.lua.org/pil/11.2.html
Fragmenter - animated loop machine and IKONOMIKON - the memory game