📄 explode.java
字号:
package game;
import game.Client;
import java.awt.*;
public class Explode {
int x,y;
private boolean alive=true;//控制爆炸生死
private Client client;
int []diameter={4,7,12,20,29,37,49,30,16,6};
int step=0;
public Explode(int x, int y,Client client) {
this.x = x;
this.y = y;
this.client=client;
}
public void draw(Graphics g){
if(!alive){
client.explodes.remove(this);//处理爆炸消亡
return;
}
Color c=g.getColor();
g.setColor(Color.ORANGE);
if(step==diameter.length){
alive=false;
step=0;
return;
}
g.fillOval(x, y, diameter[step], diameter[step]);
g.setColor(c);
step++;
//myTank.move();
}
public Rectangle getRect(){
return new Rectangle(x,y,diameter[step],diameter[step]);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -