I'm struggling with something somehow basic :)
As you can see in this line of code, I use an index (i) to select a certain value inside an array:
tiles[i].addChild(block);
and I would like to be able to do the same, but to push something into an array, on this line:
tile0Content.push(block.identifier);
I don't know how to do this, but I imagine something like this (with i instead of 0):
tileiContent.push(block.identifier);
I could of course manually copy paste my code but it's very unpractical + my index will vary depending on situations so it would be very VERY practical to be able to push values inside my arrays using an index :)
thx to everyone reading my post <3
EDIT: I think my post isnt perfectly clear on what I want to accomplish, but I could sum it up like this: Instead of doing:
tile0Content.push(block.identifier);
tile1Content.push(block.identifier);
tile2Content.push(block.identifier);
I would like to do:
for(var i = 0;i<myIndex.length;i++){
tileiContent.push(block.identifier);
}