Question: Consider the following Processing program that draws a circle which travels from top to bottom and finally disappears from the screen. int y = 10;

Consider the following Processing program that draws a circle which travels from top to bottom and finally disappears from the screen.

int y = 10; void setup() { size(480, 270); } void draw() { background(255); stroke(0); fill(175); ellipse(width/2, y, 20, 20); y++; }
 
Question) Modify the above program so that the circle (with a black fill) bounces back on reaching the 3/4th of the height of the screen and keeps on performing the same behavior (i.e., from top to 3/4th of the height of the screen and back to the top and so on). 
 
Can you Please use "processing programming" to code it.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!