Making the ball jump?

I’ve got problem with the ball, i have a maze w/ walls, the jumping of the ball seems ok but when it hit the wall it seems to go out of control and goes out of the maze. I have an up, down , left , right and jump movement.
The ball will jump when i hit the space key and will only jump if it is touching the floor of the maze. So i have a keyboard sensor and a touch sensor connected to a controller. this seems ok but when the ball hit the wall it jumps so high and goes out of bounds. The maze has to Material , the floor and the wall. How can i prevent this from happening.

I will also ask about the camera that I want to follow the ball that seems to rotate when I move the ball around.

You’ll haev to make your walls have a different material than your ground. Or you can seperate the walls and ground into 2 objects (select the wall vertices and hit P while in editmode) and assign each a different property, and use the property aspect of the touch sensor.

or vertex parent an empty to the ball and when the empty detect the ground on the -z axis at ? distance, make it jump.