//----------------------//------------------------//

        public virtual void LoadContent()
        {
            Content = new ContentManager(SceneManager.Instance.Content.ServiceProvider, "Content");
            _fpsCounter = new FramesPerSecondCounter();
            _debugFont = Content.Load<SpriteFont>("fonts/DebugFont");
            DebugValues = new Dictionary<string, string>();
        }
Exemple #2
0
        /* Everything here is identical to Level-1 besides the mother ship creations locate in LoadContent() */
        public Level_2(Game1 game)
            : base(game)
        {
            Content.RootDirectory = "Content";
            IsMouseVisible = false;
            this.game = game;
            _previousState = Keyboard.GetState();
            _world = new World(Vector2.Zero); //There's zero gravity in outerspace.
            _frames = new FramesPerSecondCounter();

            //game.IsFixedTimeStep = false; //unlock frames
        }
        protected override void Initialize()
        {
            _fpsCounter = new FramesPerSecondCounter();
            _viewportAdapter = new BoxingViewportAdapter(Window, GraphicsDevice, 800, 480);
            _camera = new Camera2D(_viewportAdapter);
            //{
            //    MinimumZoom = 0.1f,
            //    MaximumZoom = 2.0f,
            //    Zoom = 0.7833337f,
            //    Origin = new Vector2(400, 240),
            //    Position = new Vector2(408, 270)
            //};

            Window.AllowUserResizing = true;

            base.Initialize();
        }
        protected override void Initialize()
        {
            _fpsCounter = new FramesPerSecondCounter();
            _viewportAdapter = new BoxingViewportAdapter(GraphicsDevice, 800, 480);
            _camera = new Camera2D(_viewportAdapter)
            {
                MinimumZoom = 0.5f,
                MaximumZoom = 2.0f,
                Zoom = 0.5f,
                Origin = new Vector2(400, 240),
                Position = new Vector2(408, 270)
            };

            Window.AllowUserResizing = true;
            Window.ClientSizeChanged += (s, e) => _viewportAdapter.OnClientSizeChanged();

            base.Initialize();
        }
 public FramesPerSecondCounterComponent(Game game, int maximumSamples = 100)
     : base(game)
 {
     fpsCounter = new FramesPerSecondCounter(maximumSamples);
 }
Exemple #6
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()
        {
            // TODO: Add your initialization logic here

            fpsCounter = new FramesPerSecondCounter();
            viewportAdapter = new BoxingViewportAdapter(GraphicsDevice, Settings.ResolutionWidth, Settings.ResolutionHeight);
            camera = new Camera2D(viewportAdapter)
            {
                Zoom = 1f
            };
            IsMouseVisible = true;

            //Window.AllowUserResizing = true;
            Window.ClientSizeChanged += (s, e) => viewportAdapter.OnClientSizeChanged();
            DatabaseConnector.SetConnectionString(Settings.ServerName, Settings.Username, Settings.Password, Settings.DatabaseName);
            base.Initialize();
        }
 public FramesPerSecondCounterComponent(Game game, int maximumSamples = 100)
     : base(game)
 {
     fpsCounter = new FramesPerSecondCounter(maximumSamples);
 }
 public FramesPerSecondCounterComponent(Game game)
     : base(game)
 {
     _fpsCounter = new FramesPerSecondCounter();
 }