Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

My problem most times is that because I check most of the character collision for the whole thing, if you go into a wall enough on both axes,   it just puts you all the way out of an entire chink of tiles, as updating one axis the right amount won’t fix the other axis. I often use the old position on the opposite axis when calculating the first axis (though I think I just get lucky some times)

(Also, I wrote all this assuming we’re both talking about collisions where you push the character to the position they should be instead of reverting to the old position [also the vid doesn’t have a velocity more than 1 in each axis I think, so it doesn’t have to deal with that])

Edit: I don't think I made much sense, but to hopefully to make this clearer: the problems I have are mostly to do with going into walls with velocities that make it hard to tell exactly where the character has to be moved, as both axes have to move the character out the perfect number of pixels to make it look right, and you you don't hover or partially in the block.

The reason I didn’t spend much time on the character collision in this one because I just set the x to the old position instead of pushing you up against a wall (meaning you actually don't slide up all the way against a wall in most cases) ;)

Usually, I just revert back to an old position, which can be somewhat jarring when the character is in free-fall and is moving in large enough steps that it ends up floating. Overall, the video with the adjustment that I stated works well for me (: I often just ignore the slight "floating", where the character dellerates, just before hitting a surface. I don't know if it would be possible to adapt the video's system in order to feature quarter steps, like is used in mario 64. That could prevent the jarring. I'm sorry that I'm not more knowledgable on other systems, but the one in the video, maybe with a few adaptations seemed to work well for me. I actually used it in a previous game jam game (admittedly which is not as good as yours), but if you want to try it, you can play it here: https://ossoace.itch.io/find-fakes or here: https://www.zel.us/games/fake_find/. Hopefully it helps! And, I'll have a look into your system. It sounds interesting!

Well, my code is probably hard to read, and just reverts the x-axis to it's old position.

If you want to find a better system, I think this game of mine: https://void-gamesplay.itch.io/the-return-of-timmy-the-grappling-hook has a pretty solid collision system.

Anyway, thanks for the help! Its made me think a bit about collisions without barging head first into the code.