wall.java

来自「坦克大战代码」· Java 代码 · 共 30 行

JAVA
30
字号
package com.caizi;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Rectangle;


public class Wall {
	
	private int x,y,width,height;
	TankClient tc;
	
	public Wall(int x, int y, int width,int height, TankClient tc){
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height;
		this.tc = tc;
	}
	public void draw(Graphics g){
		Color c = g.getColor();
		g.setColor(Color.BLUE);
		g.fillRect(x, y, width, height);
		g.setColor(c);
	}
	
	public Rectangle getRect(){
		return new Rectangle(x,y,width,height);
	}
}

⌨️ 快捷键说明

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