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;
        }
Beispiel #2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            viewportHeight = graphics.GraphicsDevice.Viewport.Height;
            viewportWidth  = graphics.GraphicsDevice.Viewport.Width;

            //string[] playList = { "Song1", "Song2", "Song3" };
            //sound.StartPlayList(playList);

            base.Initialize();

            //The background game component creates this
            //we want access so we get the service after the components initialize
            sbm = (ScrollingBackgroundManager)Services.GetService(
                typeof(IScrollingBackgroundManager));
        }
Beispiel #3
0
        public Game1()
        {
            random   = new Random();
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth  = 1000;
            graphics.PreferredBackBufferHeight = 600;


            scrollingBackgroundManager = new ScrollingBackgroundManager(this, "Textures\\");
            Components.Add(scrollingBackgroundManager);



            ScreenWidth  = graphics.PreferredBackBufferWidth;
            ScreenHeight = graphics.PreferredBackBufferHeight;

            Content.RootDirectory = "Content";

            inputHandler = new InputHandler(this);
            Components.Add(inputHandler);

            celAnimationManager = new CelAnimationManager(this, "Textures\\");
            Components.Add(celAnimationManager);



            player            = new Player(this);
            ghost_for_cloning = new Ghost(this, player, random);
            sprites           = new List <Sprite>()
            {
                new Ghost(this, player, random),
                new Ghost(this, player, random),
                new Ghost(this, player, random),
                new Ghost(this, player, random),
                ghost_for_cloning,
                player
            };

            foreach (Sprite sprite in sprites)
            {
                Components.Add(sprite);
            }

            Components.Remove(ghost_for_cloning);//we dont want to draw this ghost
        }
Beispiel #4
0
 public Background(Game game, string contentPath)
     : base(game)
 {
     sbm = new ScrollingBackgroundManager(game, contentPath);
     game.Components.Add(sbm);
 }