How do I make my bouncing ball gradually get bigger?

edited February 2018 in How To...

I'm having a hard time

Tagged:

Answers

  • This question doesn't give us nearly enough information to try to help you. In the future, please try to post a MCVE showing exactly what you're stuck on.

    But basically, you need to change a variable over time to create an animation. Shameless self-promotion: here is a tutorial on creating animations in Processing.

    But if you have a bouncing ball, then you already understand how to change a variable over time to create an animation. Just do what you're already doing, but with size instead of position.

    If you still can't get it figured out, then please break your problem down into smaller steps and focus on one step at a time. Don't worry about a bouncing ball. Show a single hard-coded circle. Then make it so the size changes over time. Get that working perfectly before integrating it into your main sketch.

    Then if you get stuck, you can post a MCVE along with a more specific question, and we'll go from there. Good luck.

  • edited February 2018

    Agree with KevinWorkman's advice.

    Here is working bouncing ball code from the reference examples:

    https://processing.org/examples/bounce.html

    Now, suppose that

    1. IF the ball hits a wall
    2. its radius changes by +5

    Can you imagine how you might add that new behavior to this concrete example?

    Now, consider your bouncing ball, which might work differently... and you might want to share here....

Sign In or Register to comment.