Esempio n. 1
0
        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;
        }
Esempio n. 2
0
 public void moveRight()
 {
     if (platoon.platoonBox.end.x <= movingWidth)
     {
         platoon.moveRightAll(movingSpeed);
     }
 }