public BuildingBoardState(Game game) : base(game)
        {
            game.Services.AddService(typeof(IBuildingBoardState), this);
            scrollingBackgroundManager = new ScrollingBackgroundManager(game, "Textures\\");
            game.Components.Add(scrollingBackgroundManager);
            scrollingBackgroundManager.ScrollRate = -1f;

            celAnimationManager = (ICelAnimationManager)game.Services.GetService(typeof(ICelAnimationManager));

            startMenuState = (StartMenuState)game.Services.GetService(typeof(IStartMenuState));


            allHidenPoints = SetHidenTiles();   // set all the allHidenPoints
            player         = new Player(game)
            {
                myTurn = true
            };

            enemy        = new Player(game);
            player.pawns = new Pawn[player.army_size];
            enemy.pawns  = new Pawn[player.army_size];


            remainShapesToPutOnBigEmptyBoard = 5; // set the number of shapes we exepted on board as 5
            soundEffect = (ISoundManager)game.Services.GetService(typeof(ISoundManager));
            isPlayBadPlaceSoundEffect = true;     // for the algorithm about activate the badPlace sound
            // we dont see any shape:
            dragingShape = null;
            hideShape    = true;
        }
Exemplo n.º 2
0
        public Pawn(Game game, String _flag_animation, Tile _tile, int _strength, Team _team, int _id, SpriteFont _strength_font)
        {
            celAnimationManager = (ICelAnimationManager)game.Services.GetService(typeof(ICelAnimationManager));

            flag_animation = _flag_animation; //setting animation.


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

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

            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.
        }
Exemplo n.º 3
0
        public ChooseFlagState(Game game) : base(game)
        {
            game.Services.AddService(typeof(IChooseFlagState), this);
            startMenuState = (StartMenuState)game.Services.GetService(typeof(IStartMenuState));

            celAnimationManager = (ICelAnimationManager)game.Services.GetService(typeof(ICelAnimationManager));
            color = Color.White;
        }
Exemplo n.º 4
0
 public PlacingSoldiersState(Game game) : base(game)
 {
     game.Services.AddService(typeof(IPlacingSoldiersState), this);
     buildingBoardState         = (BuildingBoardState)game.Services.GetService(typeof(IBuildingBoardState));
     celAnimationManager        = (ICelAnimationManager)game.Services.GetService(typeof(ICelAnimationManager));
     scrollingBackgroundManager = (IScrollingBackgroundManager)game.Services.GetService(typeof(IScrollingBackgroundManager));
     inputHandler = (IInputHandler)game.Services.GetService(typeof(IInputHandler));
 }
Exemplo n.º 5
0
 public Enemy(Game game, Vector2 newPos, int id, ref Player player) : base(game)
 {
     this.id             = id;
     playerPosition      = player.Position;
     position            = newPos;
     celAnimationManager = (ICelAnimationManager)game.Services.GetService(typeof(ICelAnimationManager));
     inputHandler        = (IInputHandler)game.Services.GetService(typeof(IInputHandler));
 }
Exemplo n.º 6
0
        public PlayingState(Game game)
            : base(game)
        {
            game.Services.AddService(typeof(IPlayingState), this);
            placingSoldiersState       = (PlacingSoldiersState)game.Services.GetService(typeof(IPlacingSoldiersState));
            scrollingBackgroundManager = (IScrollingBackgroundManager)game.Services.GetService(typeof(IScrollingBackgroundManager));
            celAnimationManager        = (ICelAnimationManager)game.Services.GetService(typeof(ICelAnimationManager));

            teleports = new Tile[4];
        }
Exemplo n.º 7
0
        public Player(Game game) : base(game)
        {
            celAnimationManager = (ICelAnimationManager)game.Services.GetService(typeof(ICelAnimationManager));
            inputHandler        = (IInputHandler)game.Services.GetService(typeof(IInputHandler));

            position = new Vector2(100f, 500f);

            speed = 5f;
            life  = 100;
        }
Exemplo n.º 8
0
        public Ghost(Game game, Player _player, Random random) : base(game)
        {
            player = _player;

            celAnimationManager = (ICelAnimationManager)game.Services.GetService(typeof(ICelAnimationManager));

            float y = random.Next(0, Game1.ScreenHeight);
            float x = random.Next(Game1.ScreenWidth / 2, Game1.ScreenWidth);

            position = new Vector2(x, y);
            //map_position = position.X;
            speed          = 1f;
            knockOut_speed = 10;
            life           = 30;
        }
Exemplo n.º 9
0
 public Player(Game game) : base(game)
 {
     celAnimationManager = (ICelAnimationManager)game.Services.GetService(typeof(ICelAnimationManager));
     inputHandler        = (IInputHandler)game.Services.GetService(typeof(IInputHandler));
 }