Code: Select all
function land(ship_fixture,planet_fixture)
ship_fixture:getBody():setAngle(1/(math.cos(ship_fixture:getBody():getX()-planet_fixture:getBody():getX()-planet_fixture:getShape():getRadius())))
end
function beginContact(a, b, coll) --when the objects initially collide, ship is a
if a:getUserData()=="ship" then
a:getBody():setLinearVelocity(0,0)
land(a,b)
end
end
function endContact(a, b, coll) --when the objects stop touching
--null
end
function preSolve(a, b, coll) --while the objects are touching
--null
end
function postSolve(a, b, coll, normalimpulse1, tangentimpulse1, normalimpulse2, tangentimpulse2) --dont know what the f*** this is
--null
end