Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Before you make a thread asking for help, read this
- Posts: 24
- Joined: Sat Jul 29, 2017 6:48 am
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:
Code: Select all
if love.keyboard.isDown("w") then
playerY = playerY - speed
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?
- Posts: 80
- Joined: Thu May 28, 2015 8:45 pm
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
Users browsing this forum: No registered users and 32 guests