You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
986 B
53 lines
986 B
package com.msb.model;/**
|
|
* @Author bingor
|
|
* @Date 2022/10/9 17:42
|
|
* @Description: com.msb.model
|
|
* @Version: 1.0
|
|
*/
|
|
|
|
import com.msb.model.abstracts.BaseExplode;
|
|
|
|
import java.awt.*;
|
|
|
|
/**
|
|
*@ClassName CycleExplode
|
|
*@Description TODO
|
|
*@Author bingor
|
|
*@Date 2022/10/9 17:42
|
|
*@Version 3.0
|
|
*/
|
|
public class CircleExplode extends BaseExplode {
|
|
private int x,y;
|
|
private GameModel gameModel;
|
|
private int step = 0;
|
|
|
|
public CircleExplode(int x, int y, GameModel gameModel) {
|
|
this.x = x;
|
|
this.y = y;
|
|
this.gameModel = gameModel;
|
|
}
|
|
|
|
@Override
|
|
public void paint(Graphics g) {
|
|
|
|
Color color = g.getColor();
|
|
g.setColor(Color.RED);
|
|
g.fillOval(x, y, 10*step, 10*step);
|
|
step++;
|
|
if(step >= 10) {
|
|
step = 0;
|
|
gameModel.explodes.remove(this);
|
|
}
|
|
g.setColor(color);
|
|
|
|
}
|
|
|
|
public int getX() {
|
|
return x;
|
|
}
|
|
|
|
public int getY() {
|
|
return y;
|
|
}
|
|
}
|