-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParticles.java
More file actions
44 lines (31 loc) · 773 Bytes
/
Particles.java
File metadata and controls
44 lines (31 loc) · 773 Bytes
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
public class Particle {
private float xPos, yPos, xVel, yVel;
public Particle( float xPos, float yPos, float xVel, float yVel ){
this.xPos = xPos;
this.yPos = yPos;
this.xVel = xVel;
this.yVel = yVel;
}
public void setParticle( float xPos, float yPos, float xVel, float yVel ){
this.xPos = xPos;
this.yPos = yPos;
this.xVel = xVel;
this.yVel = yVel;
}
public float getxPos(){
return xPos;
}
public float getyPos(){
return yPos;
}
public float getxVel(){
return xVel;
}
public float getyVel(){
return yVel;
}
public void draw(Graphics2D g) {
g.setColor(color.BLUE);
g.drawOval((int)xPos - width / 2, (int)yPos - height / 2, width, height);
}
}