I am messing around with collision detection and I have seem to encountered a problem. If an object is moving any fast than around 4.2 pixels each tick. I was using something like:
if love.keyboard.isDown("w") then
playerY = playerY - speed
end
If speed was more than 4.2 the game wouldn't update fast enough and would phase through objects because the collision detection wouldn't register until the object was already into it. How do I fix it?
approach 1: implement swept collisions, or steal a collision engine that does it for you
approach 2: just increase the tickrate until it stops being a problem :p
approach 1.5: instead of increasing the tickrate of the entire game, do "subticks" where you lerp between the old tick and the new one, so to move from x = 0 to x = 10, you'd have a frame in the middle where x = 5 and so on