for i=1,len do
local other_ = cols[i].other
if other_.isCoin then
print('coin')
elseif other_.isExit then
print('exit')
elseif other_.isSpring then
print('spring')
end
print('collided with ' .. tostring(cols[i].other))
end
print('collided with ' .. tostring(cols[i].other))
only returns two collsion tables:
collided with table: 0x0d82b440
collided with table: 0x0d820738
which I'm guessing is where i spawn in; what i need is for this to continually loop but not interrupt the rest of the code
You have two calls to world:move. The first call (on line 33 of sprite.lua in the version you've attached) has dx=0 dy=0 because it is placed before checking the keys. Therefore the goal will always be the current player position, producing no movement, and no collision will happen.
Remove the first call and use the second one to check for collisions.
You have no isExit, isSpring etc. in the objects, so it makes no sense to check those. You only have x and y. If you want to add more attributes, do so in lobby.lua, in the table you add with sprite:add_collision({...},...) because whatever you add there, you will get it back in the collisions. For example, sprite:add_collision({type=character}, ...) will store the map character in the collision, and then when checking for collisions, you'll find that cols[i].other.type is the character of the map for that tile. You probably want to add a type to the player object too, in line 26 of sprite.lua.
The initial player position is inside a wall. Fix that.