コード例 #1
0
        private Piece NewSpearman(int x, int y, Color teamColor)
        {
            Piece fighter = new Piece(_board.spearman, _board.Fields[x, y], _board.cellSize, 4, cleverAI, _board);

            fighter.Armor        = 2;
            fighter.AttackDamage = 5;
            fighter.Health       = 7;
            fighter.teamColor    = teamColor;
            _board.Pieces.Add(fighter);
            fighter.InsertOnBoard();
            return(fighter);
        }
コード例 #2
0
        private Piece NewAxeman(int x, int y, Color teamColor)
        {
            Piece axeman = new Piece(_board.axeman, _board.Fields[x, y], _board.cellSize, 3, cleverAI, _board);

            axeman.Armor        = 0;
            axeman.AttackDamage = 7;
            axeman.Health       = 9;
            axeman.teamColor    = teamColor;
            _board.Pieces.Add(axeman);
            axeman.InsertOnBoard();
            return(axeman);
        }
コード例 #3
0
        private Piece NewKnight(int x, int y, Color teamColor)
        {
            Piece knight = new Piece(_board.fighter, _board.Fields[x, y], _board.cellSize, 3, cleverAI, _board);

            knight.Armor        = 3;
            knight.AttackDamage = 4;
            knight.Health       = 9;
            knight.teamColor    = teamColor;
            _board.Pieces.Add(knight);
            knight.InsertOnBoard();
            return(knight);
        }
コード例 #4
0
 public void Update(GameTime gameTime, Piece piece)
 {
     //    Console.WriteLine("steps "+steps);
     if (steps > 0)
     {
         steps--;
         Point   dPoint   = Destination.GridPoint - piece.Field.GridPoint;
         Vector2 dVector2 = new Vector2(dPoint.X * 32, dPoint.Y * 32);
         piece.MoveVector += dVector2 / STEPS;
     }
     else
     {
         piece.RemoveFromBoard();
         piece.Field = Destination;
         piece.InsertOnBoard();
         piece.MoveVector = Vector2.Zero;
         piece.ActionPoints--;
         //call piece finished moving
         //   battleBoard.ActionComplete();
     }
 }