ICM Week 2

Published September 19, 2017

For week two, I had big ambitions, and somewhat less exciting results.  My ambitions were twofold:

  1. to create an interactive animation that allowed someone to use the mouse to blow up a balloon, then have it float away when released, and

  2. (at someone’s very kind suggestion) to have a mouse click make a progressively larger ball, which, on a mouse release, would drop down at a rate in accordance with its size.

The question I didn’t manage to overcome in both of these scenarios was this: how to keep track of the balloon or bowling ball after if has been dropped?  How can I have two states: one in which the ball is held by the mouse, the other in which the ball is free to float / drop.  Additionally, because I would like to give the user the ability to blow up multiple balls, how can I keep track of /keep redrawing these multiple separate shapes when the number of shapes is not pre-determined? I believe the answer revolves around a list (of coordinates) and a for loop, but I wasn’t entirely sure how to implement this.

So, what I have is a somewhat less dynamic animation, which allows the user to create circles of progressively larger size as they hold down their mouse, of a fill color determined by their location, and on a background that is randomly generated.  Maybe next week I can move a little further towards combining multiple elements (user created ball, gravity, multiple balls).

Original: http://alpha.editor.p5js.org/embed/Bk4jJnF5-