I’m new to Lua and wanted some insight before I dig too deep into my project. I am working on porting over some old code I had written in Javascript for a game, but this time I want to be as efficient as possible.
I have a 2d array of 1s and 0s like so:
myArray = {{0,0,1.0,0}, {0,0,0,1,0}, {0,0,0,1,0}, {0,0,0,1,0}, {1,0,0,1,0}, {0,0,0,1,0}, {0,1,0,1,0}, {0,0,0,1,0}, {0,0,0,1,0}, {1,0,0,1,0}, {0,0,0,1,0}, {0,1,0,1,0}, {0,0,0,1,0}, {1,1,0,0,0}}
I want this array to stream in from the top to the bottom of the screen.
I will also be needing to add a collision hit test to them to see if my hero collided with one.
Should I initialize the entire array of images (with physics bodies) and then move the entire array all at once, or only create the images as I need them?
How should I go about doing this? Any thoughts or code is welcome, thank you!