I am working with Lua on Windows. I am working creating a border that isn't square. I have all the pixel coordinates saved in a table:
local borderCoords = {
{x = 100, y = 200},
{x = 101, y = 201}
-- plus a lot more coordinates
}
This table has almost 300 coordinates in it. I am then looping through each item in the table and reading the x and y coords in order to create a collider at that point:
for i=1,#borderCoords do
Boundry(borderCoords[i].x, borderCoords[i].y, 1, 1):add()
end
This is working on PC, but it does take a second to load. When I try it on my device the frame rate is EXTREMELY slow. Is there a more efficient way to do this? I haven't worked with Lua a whole lot so I know I'm missing something, just wanted to give it a try the only way I knew how.
Boundry is class I created just to put a pixel-sized sprite with a pixel sized collider rect.
Heres a screen shot of it working on pc:
Edit: I managed to increase the frame rate a bit by removing coordinates from the table after they have been used, but the frame rate is still to slow to even be playable.
borderCoords[i][#borderCoords[i]] = nil;