How do you prevent sliding down slopes?

Blitz3D Forums/Blitz3D Programming/How do you prevent sliding down slopes?

jfk EO-11110(Posted 2003) [#1]
I am using something similar like the gravity system in the castle markio demo, including the jump routine.

The problem is when my actor is standing on a slope, ramp or stairway, he tends to slide down the slope, even if it's only slightly uneven. Of course I already use a Collision method that does NOT slide down slopes, but it's the additional gravity that is making it sliding down.

How did you solve this problem? Please don't point me to comlex Physics systems I don't want to rewrite my games, it's only this little problem I want to solve.

Thanks for you suggestions.


fredborg(Posted 2003) [#2]
You could do it as simple as:
If CollisionNY(whatever)=0.0
Apply gravity
End If
Or you could do something like:
gravity = gravity * (1.0-CollisionNY(whatever))

Something like that anyways :)


jfk EO-11110(Posted 2003) [#3]
thanks a lot!!! well, in my complicated spaghetti patchwork style code it wasn't THAT simple, but finaly I nailed it. phewh! :)