?? protectwall.java
字號:
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Rectangle;
public class ProtectWall {
int x,y,w,h;
private boolean life = true;
Tank t;
public ProtectWall(int x,int y,int w, int h,boolean life) {
this.x = x;
this.y = y;
this.w = w;
this.h = h;
this.life = life;
}
public void draw(Graphics g) {
if(!life) return;
Color c = g.getColor();
g.setColor(Color.gray);
g.fillRect(x, y, w, h);
g.setColor(c);
}
public Rectangle getRect() {
return new Rectangle(x,y,w,h);
}
public boolean isLife() {
return life;
}
public void setLife(boolean life) {
this.life = life;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -