-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCloud.java
More file actions
76 lines (48 loc) · 1.31 KB
/
Copy pathCloud.java
File metadata and controls
76 lines (48 loc) · 1.31 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.awt.Color;
import java.awt.geom.Arc2D.Double;
import java.awt.geom.Arc2D;
import java.awt.GradientPaint;
import java.util.Random;
/**
* Creates an animated cloud
*
* @Ibrahim Shah
* @11/22/2020
*/
/**
* A cloud of specificed X coordinate and Y coordinated, specified width and height
*
*/
public class Cloud
{
private int x;
private int y;
private int w;
private int h;
/**Constructs a cloud at x coordinated toBeX, y coordinate toBeY, width toBeW, and height toBeH*/
public Cloud(int toBeX, int toBeY, int toBeW, int toBeH){
x = toBeX;
y = toBeY;
w = toBeW;
h = toBeH;
}
/**
* @param g2 Graphics module to draw to
*
*
*/
public void draw(Graphics2D g2){
Ellipse2D.Double cloud = new Ellipse2D.Double(x,y,w,h);
g2.setColor(Color.WHITE);
g2.draw(cloud);
g2.fill(cloud);
}
public void changeX(int valueToChange){
x = valueToChange;
}
}