private void invadeMoving() { moveCount++; double step = Def.enemyInvade; int nowSpeedCount = Def.leastInvadeSpeedCount + slowestOffset * (platoon.count() / Def.InvadeSpeedChange); if (moveCount < nowSpeedCount) { return; } if (nowGoRight) { platoon.moveRightAll(step); if (!invadingArea.contain(platoon.platoonBox)) { nowGoRight = false; platoon.moveLeftAll(step); downInvading(); } } else { platoon.moveLeftAll(step); if (!invadingArea.contain(platoon.platoonBox)) { nowGoRight = true; platoon.moveRightAll(step); downInvading(); } } moveCount = 0; }
public void organizeAttacker() { if (platoon.count() != 0) { pAttacker.respawnAttacker(); return; } Squad squad = new Squad(0, 1); //PlayerAttacker attacker = new PlayerAttacker(initialPosition, 0); pAttacker = new PlayerAttacker(initialPosition, 0); squad.assignAttacker(pAttacker); platoon.assignSquad(squad); }