Beispiel #1
0
        protected override void Initialize()
        {
            manager = new GameStateManager();

            IsMouseVisible = true;

            /* Set up the resolution.
             * If single monitor is false, we will put the game on the second monitor,
             * assuming both monitors are the same size and the left one is primary. */
            graphics.PreferredBackBufferWidth  = 1920;
            graphics.PreferredBackBufferHeight = 1080;

            if (test)
            {
                graphics.PreferredBackBufferWidth  = 800;
                graphics.PreferredBackBufferHeight = 800;
            }

            WorldArena.Instance().MinPoint = Vector2.Zero;
            WorldArena.Instance().MaxPoint = new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);

            bool singleMonitor = false;

            User32.SetWindowPos(
                (uint)this.Window.Handle, 0,
                singleMonitor ? 0 : graphics.PreferredBackBufferWidth, 0,
                graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight,
                0);
            graphics.ApplyChanges();
            base.Initialize();
        }
        public override void Update(GameTime gameTime)
        {
            string output = "";

            s.Restart();
            WorldArena.Instance().Update(gameTime);
            EmitterManager.Update(gameTime);
        }
 public override void Draw(GameTime gametime)
 {
     spriteBatch.Begin();
     //spriteBatch.Draw(grass, grass.Bounds, Color.White);
     tile();
     WorldArena.Instance().Draw(spriteBatch);
     ScoreManager.Draw(spriteBatch);
     EmitterManager.Draw(spriteBatch);
     spriteBatch.End();
 }