Dele image inside array

Hi everobody,

I have a problem for remove one image.

I create one local variable with the path of the image

later, I insert this image in a bidirectional array

local img = “image/troop/1.png”

ARRAY[0][0].image = display.newImage( img, 100, 100)

How can I delete this image for insert a new one?

My objetive is delete the image in this position and insert in a new position

Thanks in advance!

Regards!

If I read fine, you want just to change it’s position?

yes,

Im developing a war game over a map

I save the players stats in a bidirectional array (map position) like:

ARRAY[i][j].id_tropa = “-”

ARRAY[i][j].id_pj = “-”

ARRAY[i][j].hp = “-”

ARRAY[i][j].image = display.newImage( img, 100, 100)

When the cell in the map is empty, I assign “-” character for be empty

During Atack pashe, one position of the bi-directional array with data, turn to empty(death).

My problem is for delete the image. Delete the object inside the array, because if assign “-” to the image:

ARRAY[i][j].image = “-”

The cell will be empty, but the image persist in the map

If I read fine, you want just to change it’s position?

yes,

Im developing a war game over a map

I save the players stats in a bidirectional array (map position) like:

ARRAY[i][j].id_tropa = “-”

ARRAY[i][j].id_pj = “-”

ARRAY[i][j].hp = “-”

ARRAY[i][j].image = display.newImage( img, 100, 100)

When the cell in the map is empty, I assign “-” character for be empty

During Atack pashe, one position of the bi-directional array with data, turn to empty(death).

My problem is for delete the image. Delete the object inside the array, because if assign “-” to the image:

ARRAY[i][j].image = “-”

The cell will be empty, but the image persist in the map