Example #1
0
        public Player(Game game)
        {
            chooseFlagState      = (ChooseFlagState)game.Services.GetService(typeof(IChooseFlagState));
            buildingBoardState   = (BuildingBoardState)game.Services.GetService(typeof(IBuildingBoardState));
            placingSoldiersState = (PlacingSoldiersState)game.Services.GetService(typeof(IPlacingSoldiersState));
            particleService      = (ParticleService)game.Services.GetService(typeof(ParticleService));

            army_size = 21;
        }
Example #2
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);
            particleService = new ParticleService(this, GraphicsDevice);
            Components.Add(particleService);

            // Load sounds
            string musicPath = @"Sounds\Music";
            string fxPath    = @"Sounds\SoundFX\";

            soundManager.LoadContent(musicPath, fxPath);

            CelCount celCount = new CelCount(5, 25);

            /* celAnimationManager.AddAnimation("Aura", "Aura", celCount, 10);
             * celAnimationManager.ResumeAnimation("Aura");*/

            countryList = new List <string>()
            {
                "Australia", "Brazil", "Canada", "China", "Ethiopia", "France", "India", "Israel",
                "Italy", "Jamaica", "Japan", "Macedonia", "North Korea", "Philippines", "South Africa",
                "South Korea", "Switzerland", "Turkey", "USA"
            };

            foreach (var country in countryList)
            {
                celCount = new CelCount(5, 25);
                celAnimationManager.AddAnimation(country, country, celCount, 10);
                celAnimationManager.ResumeAnimation(country);
            }


            font30         = Content.Load <SpriteFont>(@"Fonts\KaushanScript30");
            font30static   = font30;
            font300        = Content.Load <SpriteFont>(@"Fonts\KaushanScript300");
            button_texture = Content.Load <Texture2D>(@"Textures\Controls\Button1");
        }
Example #3
0
        public Pawn(Game game, string _flag_animation, Tile _tile, int _strength, Team _team, int _id, SpriteFont _strength_font)
        {
            this.game           = (Game1)game;
            celAnimationManager = (ICelAnimationManager)game.Services.GetService(typeof(ICelAnimationManager));
            particleService     = (ParticleService)game.Services.GetService(typeof(ParticleService));
            playingState        = (PlayingState)game.Services.GetService(typeof(IPlayingState));

            flag_animation = _flag_animation; //setting animation.


            if (_strength == 21)  //setting the king of flags.
            {
                the_flag = true;
            }

            id = _id;                   // pawn id (always equals strength - 1).

            current_tile = _tile;       // the current tile we are on.

            _tile.SetCurrentPawn(this); // telling the tile we are on it.

            team = _team;

            strength_font = _strength_font;

            _tile.occupied = Tile.Occupied.yes_by_me;

            strength = _strength;


            isMouseClicked = false;
            hasMoved       = false;

            position = new Vector2(_tile.GetCartasianRectangle().X, _tile.GetCartasianRectangle().Y);

            send_update = true; //initialize as true it tells the server to update this pawn for the second player.
        }