📄 smallbomb.java
字号:
import java.awt.*;
public class smallBomb{
private int xPos, yPos;
private int timeofbomb = 3;
public smallBomb(Point a){
xPos = a.x;
yPos = a.y;
}
public void draw(Graphics g){
g.setColor(Color.red);
g.fillOval(xPos-7, yPos-7, 15,15);
g.setColor(Color.orange);
g.fillOval(xPos-4, yPos-4, 9,9);
g.setColor(Color.yellow);
g.fillOval(xPos-2, yPos-2, 5, 5);
}
public void keepbombing(){
timeofbomb--;
xPos = xPos + (int)(Math.random()*1) - (int)(Math.random()*1);
yPos = yPos + (int)(Math.random()*1) - (int)(Math.random()*1);
}
public int BombTimeleft(){
return timeofbomb;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -