Now let's actually look at the physics behind slopes
with a Diagram!
As you can see there are 3 different forces
acting on our object now. We have the Normal Force, which is the
contact force between the object and the slope/ground. The
ground is pushing up on the object which makes it not fall
through the floor.
We also have the Friction force, if the
object is not moving the friction is static (our picture above
where friction is keeping it from sliding down the hill). If the
object is moving the friction is kinetic and slowing down the
object's movement.
And of course gravity-but now gravity is more
of a hassle. We cannot just point gravity down because we don't
want our character to move through the floor. So we have to
break it up into gravity of the x and y directions (though x is
what we really need).
And so using sin and cos we have that Gravity
in the X direction = |Gravity|sin(theta). This is the pull of
gravity down the hill on the object.
Looking at the forces behind the scenes is
actually helpful for a place to start when implementing game
play. If there was no friction the slope would be ice.
Gravity is acting in the x direction with a smaller
magnitude.