Loading...
Logo
Processing Forum
Here is an script to animate two rectangles,using "classes" :


My question is how to make the same visualization (using classes) ,in a way that the animation would start with one click of the user ?

Replies(1)

This kind of question gets asked a lot.  Short answer:  use a boolean variable.  Test against this in the move() method and only move if it is true.  Set the boolean to true when mouse is pressed...