⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bullet.java

📁 一个Jcreator编写的可联机的坦克大战,比较好玩,很清晰
💻 JAVA
字号:
import java.awt.*;

public class bullet implements Actor{
	public int xPos;
	public int yPos;
	public ClientModel gameModel;
	public int direction;
	public String Type = "bullet";

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

	public void draw(Graphics g){
		g.setColor(Color.lightGray);
		if(direction == 0 || direction == 1)
			g.fillRect(xPos - 1,yPos - 4, 3, 9);
		if(direction == 2 || direction == 3)
			g.fillRect(xPos - 4,  yPos - 1, 9, 3);
		gameModel.removeActor(this);
	}

	public int getxPos(){
		return xPos;
	}

	public int getyPos(){
		return yPos;
	}

	public String getType(){
		return Type;
	}
}

⌨️ 快捷键说明

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