import java.awt.*; public class CommonWall { public static final int width = 20; //设置墙的固定参数 public static final int length = 20; int x, y; TankClient tc; private static Toolkit tk = Toolkit.getDefaultToolkit(); private static Image[] wallImags = null; static { wallImags = new Image[] { // 储存commonWall的图片 tk.getImage(CommonWall.class.getResource("Images/commonWall.gif")), }; } public CommonWall(int x, int y, TankClient tc) { // 构造函数 this.x = x; this.y = y; this.tc = tc; // 获得界面控制 } public void draw(Graphics g) {// 画commonWall g.drawImage(wallImags[0], x, y, null); } public Rectangle getRect() { //构造指定参数的长方形实例 return new Rectangle(x, y, width, length); } }
最近下载更多
krispeng LV7
4月16日
lwl1207 LV4
2023年8月29日
aa12356 LV1
2023年3月26日
hkxyyz LV6
2023年3月2日
3043864991 LV2
2023年1月5日
jameshkj LV8
2023年1月1日
冰锋之泪 LV7
2023年1月1日
337110415 LV7
2022年10月24日
2483935277 LV3
2022年9月3日
微信网友_5926336788320256 LV6
2022年5月24日