Here in the section i had a single ellipse that enlarged when the mouse was pressed.
Again i started simple and drew the ellipse, stating colour, size and fill (: i then altered the size, creating an int variable which I can then manipulate in order to create the movement desired. As showen bellow (:
strokeWeight(1);
fill(#FF7182);
noStroke();
ellipse(250, 400, a, a);
I then utilized the if statement in order to produce the motion desired. As shown bellow
if (mousePressed == true) { // states that if the mouse is being pressed the following will occur..
noCursor();
ellipse(250, 400, a, a);
a = a+ 2; // this states the the ellipse will increase
Then to produce the decreaing motion when the mouse is release i utilized the if else statement as shown bellow...
else if( a>=50){ a= a-1; // stating that is the int vaule a is greater than or less than 50 a will decrease by 1 untill there
No comments:
Post a Comment