📄 blood.java
字号:
import java.awt.*;
public class Blood {
int x, y, w, h;
TankClient tc;
private boolean live=true;
int step = 0;
private int[][] pos = {{350,300},{365,300},{370,305},{375,310},{380,315},
{390,320},{400,325},{395,330}};
public void draw(Graphics g)
{
Color c = g.getColor();
g.setColor(Color.MAGENTA);
g.fillRect(x, y, w, h);
g.setColor(c);
move();
}
public Blood()
{
x = pos[0][0];
y = pos[0][1];
w = h = 10;
}
public void move()
{
step++;
if(step >= pos.length)
{
step = 0;
}
x = pos[step][0];
y = pos[step][1];
}
public boolean isLive() {
return live;
}
public void setLive(boolean live) {
this.live = live;
}
public Rectangle getRect()
{
return new Rectangle(x,y,w,h);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -