wall.java

来自「坦克大战的小游戏。可以按方向键控制坦克的移动方向。按CTRL键击毙敌方坦克。吃移」· Java 代码 · 共 26 行

JAVA
26
字号
package com.sun;
import java.awt.*;

public class Wall {
	private int w,h;
	private int x;
	private int y;
	private Tanke tc;
	public Wall(int x,int y,int w,int h,Tanke tc){
		this.x=x;
		this.y=y;
		this.w=w;
		this.h=h;
		this.tc=tc;
	}
	public void draw(Graphics g){
		Color c=g.getColor();
		g.setColor(Color.gray);
		g.fillRect(x, y, w, h);
		g.setColor(c);
	}
	public Rectangle getRec(){
		return new Rectangle(x,y,w,h);
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?