?? explode.java
字號:
import java.awt.Color;
import java.awt.Graphics;
public class Explode {
int x, y;
private int[] diameters = {4, 7, 12, 18, 26, 32, 49, 30, 14, 6};
private boolean live = true;
private TankClient tc;
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;
}
Color c = g.getColor();
g.setColor(Color.ORANGE);
g.fillOval(x, y, diameters[step], diameters[step]);
g.setColor(c);
step ++;
if(step == diameters.length) {
live = false;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -