local cancel_component = vmath.dot(self.correction, normal)
local remaining_component = (distance - cancel_component) * normal
self.correction = self.correction + remaining_component
go.set_position(go.get_position() + remaining_component)
if utility.compare_normal(normal, 0.5, true) then
self.grounded = true
end
cancel_component = vmath.dot(self.velocity, normal)
if cancel_component < 0 then self.velocity = self.velocity - cancel_component * normal end
It’s the same method used in the platformer tutorial (only my “grounded” normal is set to 0.5 instead of 0.7, which doesn’t affect anything.) Spheres see the same problem.
Here’s what the tilesource looks like in case it helps:
(Those 5 pure white squares to the right are not actually tiles, just blank spots in the png file.)