Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+5 votes

when the bubles move out of the window, how can we make the bubble go all the way down and appear up again in the window? Thank you

asked in CSC201 Spring 2021 by (1 point)

2 Answers

+4 votes

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.

answered by (1 point)
+1

Thank you!

+3 votes

Yes, like Thu said, you will basically teleport it to the bottom of the window again when it reaches the top, so it appears to simply wrap around the window.

answered by (1 point)
+1

Thank you!

...