📄 bombcommand.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 + -