wall.java

来自「一个坦克游戏程序」· Java 代码 · 共 38 行

JAVA
38
字号
package com.tankwar;


import java.awt.Color;
import java.awt.Graphics;
import java.awt.Rectangle;

public class Wall {
	
	private int x,y,w,h;
	TankClient tc = null;
	
	
	public Wall(int x, int y, int w, int h, TankClient 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.green);	
		g.fillRect(x, y, w, h);
		g.setColor(c);
		
	}
	
	public Rectangle getRect() {
		
		return new Rectangle(x, y, w, h);
		
	}
	

}

⌨️ 快捷键说明

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