Bubble popping animation

Now I look at your last sketch

here is your mistake:

The upper screen border is not height but 0 (zero)

The lower part is height.

(The point 0,0 is upper left corner)

Hence you want

  //Tried to reset riseStart when the small ball exits the window to spawn a new ball.
  if (riseStart < 0) {

or

  //Tried to reset riseStart when the small ball exits the window to spawn a new ball.
  if (riseStart < bsize2) {
1 Like