I know a lot of problems regarding collision detection have been posted on this forum before but I believe mine is unique and a little more involved. I am using the HardonCollider Library for my collision detection when I noticed a problem. Sometimes the entities would sink through the floor. The problem gets worse when more entities are introduced but still occurs when there's only one entity. I have narrowed it down and found only entities smaller than the tile size (16x16) fall through. I cannot be the only person out there who has run into this issue. Is there anyway to optimize the HardonCollider or do any of you know of an article that may be helpful?
Here is how I am instantiating the HardonCollider.
Code: Select all
collider = HC(10, on_collide, on_stop_collide) --in love.load
Also I have included a .love of the game so far so you can see the issue firsthand
Controls:
'WASD' controls movement
'q' adds another entity (currently no way to remove entities so just restart the game)
'r' resets position of all entities
'move mouse' moves camera
'scroll wheel' zooms camera
'up and down' changes scale of entities
Other important information:
When the ground changes to pink that means an entity is grounded (Best noticed with one entity)