Don't let the cat touch the edge. Use loudness to control the cat and help it eat the jam but dodge the ball at the same time.
@CodeShala