📄 explode.java
字号:
import java.awt.Color;
import java.awt.Graphics;
public class Explode {
private int x, y;
private boolean live;
private TankFrame tf;
private int[] range = {5,10,15,20,40,30,18,9,4};
private int step = 0;
public Explode(int x, int y , TankFrame tf) {
this.x = x;
this.y = y;
this.tf = tf;
}
public void draw(Graphics g) {
if(live = false) {
return;
}
if(step == range.length) {
live = false;
tf.explodes.remove(this);
step = 0;
return;
}
Color c = g.getColor();
g.setColor(Color.RED);
g.fillOval(x, y, range[step], range[step]);
g.setColor(c);
step++;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -