08-09-2020, 09:21 PM
(This post was last modified: 08-09-2020, 09:23 PM by SuperSledgeBro. Edited 1 time in total.
Edit Reason: image won't appear
)
I made a new slope collision engine that supports wide hitboxes! If you saw my other gifs, the previous system worked by checking the slopes at the center of the player. This new system I made works by checking on the two "sensor lines" on the left and right side of the player. This is similar to the logic that the 2D Sonic games use; though there are places where it doesn't work in a desirable way, such as when Sonic is standing on the ledge of a trapezoid or the top of a triangle, he won't collide with pointy shapes between the two lines. This a problem that persists in a lot of fangames as well. The method I thought of fixes this issue, somewhat. The player picks every slope inside the area between the two sensor lines, stores them in a DS list, compare the height where the two lines are on each slope, and places the character on top of the highest one. Well, this method is not without its imperfections, but at least you can't see them in the gif. It took me a lot of headaches to code this, so I don't plan on using it for anything.