Learning 2D platform collision detection
-
Hey everyone, seeking some input for this one.. so i've taken a shot at a simple 2D platformer.. just can't work out how to get collision detection working well
What you're seeing is just a big triangle collision object, ideally i'd like the character to run up the triangle and then fall at the end
Open to any feedback, ideas.. I feel the problem is how im doing my velocity control? not sure though....
-
Could probably add to the y pos axis so it goes up the screen a bit and keeps on falling onto the collision object or alter your y velocity so you don't pass through the boundary or both.
-
I'm bumping this in the hopes some bright spark can fix it for you, as I've tried to do a platformer a couple of times and can never get the collisions working right at all.
-
Is this using a Map or something else? Sorry, I can't see the code well enough to tell
-
@Martin Yup, using a map and collision objects from the built in editor
-
Code for this is: NK4N3MND5E if you'd like to check it out @Martin ?
-
Looks great, only wish I could help.