Explode.java
资源名称:source.rar [点击查看]
上传用户:kikomiki
上传日期:2021-10-31
资源大小:373k
文件大小:1k
源码类别:
游戏
开发平台:
Java
- import java.awt.*;
- public class Explode {
- int x, y;
- private boolean live = true;
- private TankClient tc ;
- int[] diameter = {4, 7, 12, 18, 26, 32, 49, 30, 14, 6};
- 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;
- }
- 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 ++;
- }
- }