Currently, I have an array inside an array that creates 25 crates when the game starts. I want to have a text with a number that has a different value on each crate. For example: each of the crates would say 1, 2, 3, 4, 5, etc, in their center.
Right now this is my code:
local crates = {} for i = 1, 5 do for j = 1, 5 do crates[i] = display.newImage( "crate.png", 300 + (i\*90), -5000 - (j\*90) ) physics.addBody(crates[i], {density = 0.1, friction = 1, bounce = 0}) end end
Also, how can I print some text into the logs that says if a crate has disappeared past a certain point? Something like: “Crate … has disappeared”. Thank you.