示例#1
0
 public PlayerCommander()
 {
     remaining            = 3;
     movingHight          = Def.playerLine;
     movingWidth          = Def.existWidth;
     movingSpeed          = Def.playerSpeed;
     platoon              = new Platoon(0, 1);
     initialPosition      = new Vector2(0.0, movingHight);
     platoon.Annihilated += Platoon_Annihilated;
 }
示例#2
0
        public EnemyCommander(int stageNum)
        {
            Vector2
                start = new Vector2(0.0, 0.0),
                end   = new Vector2(Def.invadingWidth, Def.invadingHeight);

            invadingArea = new Area(start, end);
            platoon      = new Platoon(0, col);
            makeTemplateEnemy(stageNum);
            platoon.teamDamage  += Platoon_teamDamage;
            platoon.Annihilated += Platoon_Annihilated;
            nowGoRight           = true;
            moveCount            = 0;
            attackCount          = 0;
            maxCountStep         = col * row / Def.InvadeSpeedChange;
            slowestOffset        = (Def.maxInvadeSpeedCount - Def.leastInvadeSpeedCount) / maxCountStep;
        }
示例#3
0
        private void Platoon_Annihilated(object sender, EventArgs e)
        {
            Platoon pla = sender as Platoon;

            if (remaining != 0)
            {
                remaining--;
                initialPosition = pla.platoonBox.start;
                //organizeAttacker();
                //return;
            }
            EventHandler handler = lost;

            if (handler != null)
            {
                handler(this, EventArgs.Empty);
            }
        }
示例#4
0
        public EnemyCommander(double maxrow, double maxcol, int stageNum)
        {
            Vector2
                start = new Vector2(0.0, 0.0),
                end   = new Vector2(maxrow, maxcol);

            invadingArea = new Area(start, end);
            platoon      = new Platoon(0, col);
            makeTemplateEnemy(stageNum);
            platoon.teamDamage  += Platoon_teamDamage;
            platoon.Annihilated += Platoon_Annihilated;
            nowGoRight           = true;
            moveCount            = 0;
            attackCount          = 0;
            attackTiming         = attackingRand.Next(minAttackCount, maxInvadeAttackCount);
            maxCountStep         = col * row / Def.InvadeSpeedChange;
            slowestOffset        = (Def.maxInvadeSpeedCount - Def.leastInvadeSpeedCount) / maxCountStep;
        }