# Trouble you greatly help thanks

**URL:** https://discourse.processing.org/t/trouble-you-greatly-help-thanks/7342
**Category:** Coding Questions
**Tags:** homework
**Created:** [January 9, 2019, 3:17am UTC](https://discourse.processing.org/t/trouble-you-greatly-help-thanks/7342 "2019-01-09T03:17:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![alk5603](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@alk5603](https://discourse.processing.org/u/alk5603)
#### Post date: [January 9, 2019, 3:17am UTC](https://discourse.processing.org/t/trouble-you-greatly-help-thanks/7342/1 "2019-01-09T03:17:14Z")

</div>

1. 

Randomly generate 5,000 balls with a diameter of 10, random colors, and bouncing within the canvas.

1. 

When the mouse clicks, a fixed ball (which does not run) is generated at the position where the mouse clicks. When the ball produced in step 1 hits the ball, it also becomes fixed, so one by one. Become a fixed ball until all the balls become fixed balls.

[![](https://img.youtube.com/vi/XGPzY1rmgOU/hqdefault.jpg "ex1") ](https://www.youtube.com/watch?v=XGPzY1rmgOU)

float x, p;  
void setup() {  
size(600, 800);  
x=0;  
p=1;  
background(#0F0505);  
noFill();  
stroke(#00E3FF);  
}

void draw() {  
fill(random(50), random(50), random(50));  
translate(width/2, height/2);  
rotate(x);  
ellipse(x, p, x, p);  
x=x+20;  
p=p+5;  
}

---

<div class="post-metadata">

### Author: ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)
#### Post date: [January 9, 2019, 3:47am UTC](https://discourse.processing.org/t/trouble-you-greatly-help-thanks/7342/2 "2019-01-09T03:47:10Z")

</div>

Sorry, but what’s your question? It looks like you just posted your homework assignment?

Where exactly are you stuck?
