Okay so I have collision with slopes working fairly well on my platformer but I'm thinking it could be better.
Basically, I'm using the Tiled Map Editor, and I draw polylines on the floors where you're supposed to collide. In the game, I basically create a ray between the player's current position, and the position he's going to be in next, and check if it intersects one of these lines. If it does, the "onGround" bool is set to true (which disables gravity), and then I get the gradient of the line segment, find out how far along the X axis I am of it, multiply that by the gradient and set that as the Y coordinate. Simple maths, but it works and it's solid.
However, when I'm running downhill, I'm moving along the X axis, leaving the ground for a bit, falling until I hit the ground, etc. So very little time is actually spent on the ground, which means you can't jump ('onGround' has to be true to jump).
So, I was thinking of following these paths directly, but it's a little bit complicated and I'm confused about how to do it. Note, there are many polylines per level, and most have more than one line segment to them. Does anyone have any experience with this? I could use some help.