bubble is actually a circle. So you can try getP1().getY() to know the location of the bubble. If the location is equal to 0, which means the bubble reaches the top of the window. then you can do self.circle.move(0, WINDOW_HEIGHT) to make the circle wrap around.