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

📄 bombcommand.java

📁 J2ME飞机设计游戏,希望对学习J2ME的程序员有所帮助
💻 JAVA
字号:
public class BombCommand implements Command {
	public BombCommand(){
		world = World.getInstance();
		planeActor = BattlePlaneActor.getInstance();
	}

	public void execute(int xPos, int yPos) {
		if (planeActor.getBattle_magic() >= 60) {

			// 产生爆炸效果
			world.newBullet(7, xPos, yPos - (48 << 8), 9 << 8, 0);
			world.newBullet(7, xPos, yPos - (48 << 8), -9 << 8, 0);
			world.newBullet(7, xPos, yPos - (48 << 8), 0, 9 << 8);
			world.newBullet(7, xPos, yPos - (48 << 8), 0, -9 << 8);
			world.newBullet(7, xPos, yPos - (48 << 8), 6 << 8, 6 << 8);
			world.newBullet(7, xPos, yPos - (48 << 8), -6 << 8, 6 << 8);
			world.newBullet(7, xPos, yPos - (48 << 8), -6 << 8, -6 << 8);
			world.newBullet(7, xPos, yPos - (48 << 8), 6 << 8, -6 << 8);

			//产生虚拟爆炸对象
			world.newBullet(12, xPos - (45<<8), yPos - (93 << 8), 0, 0);  //设置爆炸的左上顶点坐标

			//planeActor.setBattle_magic(planeActor.getBattle_magic() - 60); // 消耗魔法值
		}
	}
	
	private World world;
	private BattlePlaneActor planeActor;
}

⌨️ 快捷键说明

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