I’m kind of new to Corona and I’m working with a multi dimensional array that stores tiles for a puzzle game I’m working with.
My code looks like this:
local randomTile = getRandomTile()
tiles[column][row] = display.newImageRect(munches[randomTile], 34, 34)
tiles[column][row].y = -row \* 34
tiles[column][row].x = x
tiles[column][row].column = column
tiles[column][row].row = row
tiles[column][row].tile = randomTile
tiles[column][row].remove = false
tiles[column][row].check = false
tiles[column][row].touch = tileTouched
tiles[column][row]:addEventListener("touch", tiles[column][row])
Is it okay to add new properties to each element like I did here with the column, row, tile, remove, check?
Also if it’s fine, what happens when I replace a tile with another?
tiles[1][2] = tiles[2][2]
Do all of the properties transfer as well or just the newImageRect?
Thanks! [import]uid: 54776 topic_id: 22301 reply_id: 322301[/import]

