shield.java

来自「一个Jcreator编写的可联机的坦克大战,比较好玩,很清晰」· Java 代码 · 共 32 行

JAVA
32
字号
import java.awt.*;
public class shield implements Actor{
	public int xPos;
	public int yPos;
	public ClientModel gameModel;
	public String Type = "shield";

	public shield(int xPos, int yPos,  ClientModel gameModel){
		this.xPos = xPos;
		this.yPos = yPos;
		this.gameModel = gameModel;
	}

	public void draw(Graphics g){
		g.setColor(Color.red);
		g.drawRect(xPos - 12, yPos - 12, 25,25);
		g.drawRect(xPos - 11, yPos - 11, 23,23);
		gameModel.removeActor(this);
	}

	public int getxPos(){
		return xPos;
	}

	public int getyPos(){
		return yPos;
	}

	public String getType(){
		return Type;
	}
}

⌨️ 快捷键说明

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