📄 wall.java
字号:
import java.awt.*;import javax.swing.*;public class Wall extends JFrame { TankFrame tankFrame; Image image; int protect; int x,y; int Type; Wall(int a,int b,int Type,TankFrame tankFrame){ this.tankFrame=tankFrame; this.Type=Type; x=a; y=b; if(Type==1) image = Toolkit.getDefaultToolkit().getImage("images/53.jpg"); else if(Type==2) image = Toolkit.getDefaultToolkit().getImage("images/54.jpg"); SignProtect(); } public void SignProtect(){ if((x>=200 && x<320)&&(y>=520 && y<600)){ protect++; } else{ protect=0; } } public void draw(Graphics g){ g.drawImage(image, x, y, 20, 20, null); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -