Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
50 lines (37 loc) · 1.1 KB

File metadata and controls

50 lines (37 loc) · 1.1 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package simpleobjects;
import goo.Goo; // A
import java.awt.Color;
import java.awt.Graphics;
import java.util.Random;
public class MusicStream extends Goo { // B
VerticalBounceDrop[] dropArray;
Random rd;
public MusicStream(int width, int height) { // C
super(width, height);
dropArray = new VerticalBounceDrop[100];
rd = new Random();
for(int i=0; i<dropArray.length; i++)
{
int sizeRan = rd.nextInt(30);
int xposRan = rd.nextInt(width-sizeRan);
int yposRan = height;
int xVelRan = 0;
int yVelRan = rd.nextInt(10);
if(yVelRan == 0) yVelRan++;
int ranColorR =rd.nextInt(250);
int ranColorG =rd.nextInt(250);
int ranColorB =rd.nextInt(250);
Color color = new Color(ranColorR,ranColorG,ranColorB);
dropArray[i] = new VerticalBounceDrop(xposRan, yposRan, xVelRan, yVelRan, sizeRan,color);
}
}
public void draw(Graphics g) { // D
for(int i=0; i<dropArray.length; i++)
{
int ranHeight = rd.nextInt(getHeight()/2)+(getHeight()/2);
int ranWidth = rd.nextInt(1400);
dropArray[i].move(ranWidth, ranHeight);
dropArray[i].draw(g);
}
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.