Example #1
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()
        {
            camera = new Camera2D(GraphicsDevice.Viewport);
            mouse  = new GameMouse(Content);

            GameObject.Initialize(Content, graphics, camera, mouse);

            sm = new SceneManager(this);

            base.Initialize();
        }
Example #2
0
        public static void Initialize(ContentManager content, GraphicsDeviceManager graphics, Camera2D camera, GameMouse mouse)
        {
            ObjectsClicked = new List <GameObject>();
            Types          = new List <Type>()
            {
                typeof(Button), typeof(Card), typeof(CardFarm), typeof(CardMine), typeof(CardQuarry), typeof(Tile), typeof(GrassTile), typeof(WaterTile), typeof(UndiscoveredTile), typeof(DirtTile),
            };

            Content  = content;
            Graphics = graphics;
            Camera   = camera;
            Mouse    = mouse;

            BlankPixel  = Content.Load <Texture2D>("buttons/blankPixel");
            Spritesheet = Content.Load <Texture2D>("tiles/spritesheet");

            FontSmall  = Content.Load <SpriteFont>("fonts/silkscreen/small");
            FontMedium = Content.Load <SpriteFont>("fonts/silkscreen/medium");
            FontLarge  = Content.Load <SpriteFont>("fonts/silkscreen/large");
            FontTiny   = Content.Load <SpriteFont>("fonts/silkscreen/tiny");
            Font15     = Content.Load <SpriteFont>("fonts/silkscreen/font15");
            Font90     = Content.Load <SpriteFont>("fonts/silkscreen/font90");
        }
Example #3
0
        public static void Update(GameTime gt, GameMouse mouse)
        {
            KeyboardState kState = Keyboard.GetState();

            if (mouse.CanType)
            {
                if (kState.IsKeyDown(Keys.F3))
                {
                    Debug.DebugActive = !Debug.DebugActive;
                }

                if (Debug.DebugActive)
                {
                    if (kState.IsKeyDown(Keys.G))
                    {
                        Debug.DrawGUI = !Debug.DrawGUI;
                    }
                    if (kState.IsKeyDown(Keys.F))
                    {
                        Debug.DrawFOW = !Debug.DrawFOW;
                    }
                    if (kState.IsKeyDown(Keys.D))
                    {
                        Debug.DiscoverOnClick = !Debug.DiscoverOnClick;
                    }
                }
            }

            Time += (float)gt.ElapsedGameTime.TotalSeconds;

            if (Time > RefreshTime)
            {
                //CPUMessage = (Process.GetCurrentProcess().).ToString();

                Time = 0;
            }
        }