(Janky) Sprite Offset while on a Slope
-I just added an Sprite Y Offset value to the AngleLeft detector
-It seen to work visually better with the detector's offset at 2 and the Sprite Offset at 8
-Changed the Mask Setup event, replaced Group.Player Set Position with Set X / Y Position.
-The Y position uses this expression:
Range(Y( "Mask" ) + ( Distance(0.0, Y( "AngleLeft" ), 0.0, Y( "AngleRight" )) ), Y( "Mask" ), Y( "Mask" ) + Sprite Offset( "AngleLeft" ))
This works great but has some bugs:
When the character start to going down on a slope, it visually fall a couple of pixels, looking like it just walked in a "L" shape, it only happens at the tip of the slope.
I was thinking in using something like an Sprite X Offset, and add a range to it, just to make it only do this while on the tip of the slope.
Also, because of the bugs of the angle detection, it may be visually jumpy on top of physics objects and some things like Spikes.
And the most obvious, the mask will not match the sprite, unless something resize it too, or change the shape to match the slope.
Edit: You can also just replace the expression with this, don't need any new value:
Y( "Mask" ) + ( Distance(0, Y( "AngleLeft" ), 0, Y( "AngleRight" )) / 2 )
In this case, a middle detector would fix how the sprite start to fly off the ground in the begining of the slope (going up).
But if there was a middle detector, you could just make the character sprite stick to the middle detector =P
Sugestions on how to make the Angle Detection better:
-Add an middle detector, so it only would detect a slope if they line up or if the diference between are really small.
Also, the middle detector would be perfect for the Sprite Offset on a Slope.
-The side angle detectors could be useful for the Slope Physics at some point.