Slopes gravity

I’m trying to rework how movement works. I’m hoping anybody knows how do I stop the bouncing when the player is moving on the ground with out making the gravity. Just walk the character back and forth for a couple of seconds and the character will start bouncing.

I think the reason is why maybe try make the sprite move not go up and down by not using if is up or down is pressed, but instead just use left or right so it moves only horizontally, try that first. Here is a image that demonstrates what I mean.


Now this is all you need, do not use the other if/else if block or anything related to the up or down thingy, it could causes error on the game. Next, you have to make it if it overlaps the ground, then it can have a acceleration. But first we do not want the sprite off the screen and fall off the slope right, so here is the next thing we have to do here.

This code tells the computer that if you overlap the my sprite 8 slope, or sprite overlaps sprite 5 which is a other slope or sprite 8 which is the other slope to not make the confusing error thing in the game. The last step is to use the acceleration here is the code.
image
This allows the sprite have a acceleration to be pulled down so it can be on the floor and work and bounce.