@Davidobot, your solution is highly creative, congratulations!
I wouldn't go as far as saying that it is "the definitive answer to slopes in bump", but it is better than what has been shown so far. Thanks for sharing it.
My real-life workload has escalated significantly since I started a new job last summer, and I have not been able to look into this yet I am afraid. I know however that the proper solution is creating 4 new collision types (8 if you want to allow "corner" and "vertical center" variants). Each collision type would be similar to "slide", but with a modified rect_getSegmentIntersectionIndices function. The regular one calculates the intersection between a line and a rectangle, like this:
Code: Select all
+----------+ +----------+
| | | XX |
| | |XX |
| | ==> XO |
| | XX | |
| | | |
+----------+ +----------+
What is needed is another version of this algorithm which is able to calculate the intersection between a line and a "rectangle which is missing a corner" (as well as some math to calculate exactly how much corner to "cut"):
Code: Select all
/-------+ /------+
/ | OX |
/ | XX |
/ | ==> XX/ |
| | XX | |
| | | |
+----------+ +----------+
This would make things move like they are supposed to without needing to add platforms, etc. Unfortunately, this is the kind of mathy stuff I don't really enjoy doing, and I haven't had the will to spend my little free time researching this.
(Pull requests are welcome, by the way
!)