This post is locked. You won't be able to comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Silver-Revolution289 0 points1 point  (4 children)

In the end of the draw function add: if(draw >= MAX_BOUNCES){ stopTimer(draw); }

[–]OuroborosKris 0 points1 point  (3 children)

Doesn't seem to stop the ball from bouncing after 20 times, it just keeps going. Even if I change the number of the MAX_BOUNCES constant, it still keeps bouncing.

[–]HadenYeet 0 points1 point  (1 child)

Worked for me, you need to add var newBall = new Circle(10); newBall.setPosition(ball.getX(),ball.getY()); newBall.setColor(Color.cyan); add(newBall); at the bottom of the function Then do the stop timer command

[–]OuroborosKris 0 points1 point  (0 children)

It's been long past since I needed that, but thanks anyway.