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 moveLeft() { if (platoon.platoonBox.start.x >= 0.0) { platoon.moveLeftAll(movingSpeed); } //platoon.moveLeftAll(movingSpeed); //if (platoon.platoonBox.start.x < 0.0) //{ // platoon.moveRightAll(movingSpeed); //} }