Thanks Gandolf. I think I solved it.
The problem was related to applying the "friction" before I placed the ball. When i moved the float etc below the rest of the code it worked out.
I still have no idea what was causing the "wall" to disappear though. Although I did discover that if I add something like
if(ballVelocity.x < .01) {
ballVelocity.x =0;
}
the right-hand wall disappears, even in a fresh project which works fine otherwise. Strange.
Now to figure out how to start the ball with a swipe and have it move in the direction of the swipe... Â
