Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Collision resolution was indeed a nontrivial problem to solve, but I find it satisfying when I finally manage to solve that kind of problem. 

My solution was to simply incrementally move the player, pixel by pixel (first horizontally, then vertically) and check for collisions in each iteration. Also, in the collision resolution I gave the highest priority to pushing up, then to pushing along x axis and lastly to pushing down. That was in order to make the player movement mechanics less frustrating to the player in most cases (i.e. player has a greater chance of "squeezing up" instead of unintentionally/unexpectedly hitting the head when trying to make a jump).

(+1)

That's pretty similar to how I approached the issue. It worked absolutely fine until i started making the platforms tile-based. Then I add some really undefined behavior that I never got around to fixing.

Interestingly, for me, this is what actually solved problems with tile-based colliders. I guess the difference in outcomes comes from some other details of implementations.