I'm working on a gravity-based puzzle game, which actually is like any platformer but without the jumping skills, instead of jump, you can invert of the gravity. I'm using the love.physics to set movement and collisions, also Tiled and STI to create the maps, so to set which tiles are ground and roof, I added a custom property to the tiles, and to set whenever the player is "grounded" (on floor or root, so it can move and invert gravity), it has its own property which is updated on the preSolve() callback.
Code: Select all
function preSolve(a, b, coll)
if a:getUserData().properties.type == "ground" then
player.grounded = true
else
player.grounded = false
end
end