-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExplode.java
More file actions
39 lines (31 loc) · 829 Bytes
/
Copy pathExplode.java
File metadata and controls
39 lines (31 loc) · 829 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
package com.Tank;
import java.awt.*;
public class Explode {
int x , y ;
private boolean live = true;
private TankClient tc;
int[] diameter = { 4 ,12,18,26,32,49,30,14,6};
int step = 0;
public Explode(int x, int y, TankClient tc) {
this.x = x;
this.y = y;
this.tc = tc;
}
//±¬Õ¨Ð§¹û²»ÀíÏë
public void draw(Graphics g) {
if(!live) {
tc.explodes.remove(this);
return;
}
if(step==diameter.length) {
live = false;
step = 0;
return;
}
Color c= g.getColor();
g.setColor(Color.RED);
g.fillOval(x, y, diameter[step], diameter[step]);
g.setColor(c);
step++;
}
}