Exemplo n.º 1
1
        public ControlState controlState;                //get and set the control state
        #endregion

        #region constructor/load
        public TacticalBattle(List<Piece> player1Army, List<Piece> player2Army, TacMap map, ContentManager content)
        {
            //p1Avatar = player1;
            //p2Avatar = player2;

            this.player1Army = player1Army;
            this.player2Army = player2Army;

            isPlayer1Turn = true;
            this.map = map;
            battleOver = false;
            gridOn = false;

            mouseVisible = true;
            controlState = ControlState.selectUnit;

            selectedUnit = null;
            status = "Combat begins";
            selectionTiles = new List<Tile>();
            unitInfo = "";
            //load interface items                  TODO
            confirmation = content.Load<Texture2D>("confirmationPopup");
            background = content.Load<Texture2D>("TerrainSprites/battle");
            statusFont = content.Load<SpriteFont>("Arial");
            playerFont = content.Load<SpriteFont>("playerFont");
            infoFont = content.Load<SpriteFont>("infoFont");
            moveBox = content.Load<Texture2D>("TerrainSprites/move");
            targetBox = content.Load<Texture2D>("TerrainSprites/target");
            selectedBox = content.Load<Texture2D>("TerrainSprites/selected");
            horizontal = content.Load<Texture2D>("TerrainSprites/horizontal");
            vertical = content.Load<Texture2D>("TerrainSprites/vertical");
            winBox = content.Load<Texture2D>("Menu/Win message");
            //set units to starting positions
            startingPositions();
        }
Exemplo n.º 2
0
        public TacticalBattle(Array player1Army, Array player2Army, TacMap map, ContentManager content)
        {
            //p1Avatar = player1;
            //p2Avatar = player2;

            this.player1Army = player1Army;
            this.player2Army = player2Army;

            isPlayer1Turn = true;
            this.map = map;
            battleOver = false;

            mouseVisible = true;
            controlState = ControlState.selectUnit;

            selectedUnit = null;
            status = "Combat begins";
            selectionTiles = new List<Tile>();
            //load interface items                  TODO
            background = content.Load<Texture2D>("TerrainSprites/background");
        }
Exemplo n.º 3
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            army1 = new List<Piece>();
            army2 = new List<Piece>();

            //Load the screen backgrounds
            mTitleScreenBackground = Content.Load<Texture2D>("Menu/TitleScreen");

            //Music
            musicTitle = Content.Load<Song>("Music/Title");

            //Play the Intro Song
            MediaPlayer.Play(musicTitle);
            /*
                army1.Add( new Pikeman("RED", Content));
                army2.Add(new Pikeman("BLUE", Content));

                army1.Add(new Knight("RED", Content));
                army2.Add( new Knight("BLUE", Content));

                army1.Add(new Swordsman("RED", Content));
                army2.Add(new Swordsman("BLUE", Content));

                army1.Add(new Archer("RED", Content));
                army2.Add(new Archer("BLUE", Content));

                army1.Add(new Nomad("RED", Content));
                army2.Add(new Nomad("BLUE", Content));

                army1.Add(new Mage("RED", Content));
                army2.Add(new Mage("BLUE", Content));

                army1.Add(new Zealot("RED", Content));
                army2.Add(new Zealot("BLUE", Content));
            */

            Tile[,] mm = new Tile[30,30];
            for (int i = 0; i < 30; i++)
                for (int j = 0; j < 30; j++)
                    mm[i,j] = new Tile("Plain", i, j);

            map = new TacMap(mm, Content);
            map.randomMap();

            battle = new TacticalBattle(army1, army2, map, Content);
            manager = new ArmyManagment(Content, army1, army2);

            // TODO: use this.Content to load your game content here
        }