I'm having a problem with tables/ipairs.
Posted: Tue Jun 14, 2016 4:56 pm
Hey LÖVErs, I'm having a stupid problem with ipairs, or maybe the problem is tables.
Im testing a super minimalistic algorithm for collisions to go with a top down simplistic game.
I can add and display walls in a table, but the collision function is only working on the last wall added to the table.
As you can see from the love file, the wall on the left is collision free, yet the wall on the right it works perfectly for.
I've included the .love file for any and all to ponder. (Including comments on what I believe to be the problem area)
Thanks for anyone who will help in advance, I've been scratching my head over this for 2 days.
PS: The collision code will probably make you cringe, bare with me.[
Im testing a super minimalistic algorithm for collisions to go with a top down simplistic game.
I can add and display walls in a table, but the collision function is only working on the last wall added to the table.
As you can see from the love file, the wall on the left is collision free, yet the wall on the right it works perfectly for.
I've included the .love file for any and all to ponder. (Including comments on what I believe to be the problem area)
Thanks for anyone who will help in advance, I've been scratching my head over this for 2 days.
PS: The collision code will probably make you cringe, bare with me.[