For example, if there is a player and a platform, I can check if they are overlapping.
Code: Select all
if player.x + player.width > platform.x and
player.x < platform.x + platform.width and
player.y + player.height > platform.y and
player.y < platform.y + platform.height then
-- Player and platform are overlapping
end
For some reason I'm having a hard time trying to make sure I explain this properly, if its unclear please let me know