A bouncing ball with or without gravity