well, if the endpoint of the x-movement is inside the triangle, and the triangle has a 45degree slope,
the endposition is the hight of the triangle at this point.
Lets say its a slope going upward to the right, and you move right.
First check if the endpoint of the character is on the tile with such a slope.
If yes, check at wich % point of the tile he ends up.
Then do an interpolation how high it is there.
-> if the char is moving right, you need to check this for the lower right point of your collision box…
Or check it for both sides, and apply the highest hight.
(if the tile is 1 wide, and the endpoint is at 0.8, then the hight after pushing would be also 0.8 higher than the bottomline of the tile)
For a 45/2 degree slope (over 2 tiles), it would be 0.4 high.
Cant pull out some example code now. But it should be easy to develop it from here.
Just look at all the side conditions:
if the endtile is “full”, but the char is currently on a slope, the char will end up on TOP of the end-tile.
If there is no slope, he would collide already with the edge of the tile.