Bouncing balls in curved spacetime