⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 explode.java

📁 坦克大战的JAVA代码版
💻 JAVA
字号:
import java.awt.*;
public class Explode {
   int x,y;
   private boolean live=true;
   
   int[] diameter={4,7,12,18,26,32,49,30,14,6};
   int step=0;
  private TankClient tc;
  
  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){
		   step=0;
		   live=false;
		   return;
	   }
	   
	   
	   Color c=g.getColor();
	   g.setColor(Color.GREEN);
	   g.fillOval(x, y, diameter[step], diameter[step]);
	   g.setColor(c);
	   step++;
   }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -