package com.bjsxt.tank; import java.awt.Color; import java.awt.Graphics; public class Explode { int x, y; boolean live = true; int[] diameter = {4, 7, 12, 18, 32, 45, 16, 5}; int step = 0; private TankClient 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.ORANGE); g.fillOval(x, y, diameter[step], diameter[step]); g.setColor(c); step++; } public Explode(int x, int y, TankClient tc) { this.x = x; this.y = y; this.tc = tc; } }