Ejemplo n.º 1
0
        public Game(IView view)
        {
            _view = view;

            GameArea gameArea = new GameArea((int)view.GameViewSize.Width, (int)view.GameViewSize.Height, 6, 24);
            CameraSystem camera = new CameraSystem(view.GameViewSize, gameArea.GameAreaSize);
            _stateManager = new StateManager(gameArea, camera);

            _upTime = new Stopwatch();
        }
Ejemplo n.º 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()
        {
            // TODO: Add your initialization logic here
            this.IsMouseVisible = true;

            int width = graphics.PreferredBackBufferWidth;
            int height = graphics.PreferredBackBufferHeight;

            GameArea gameArea = new GameArea(width, height, 6, 24);
            CameraSystem camera = new CameraSystem(new Size(width, height), gameArea.GameAreaSize);

            _stateManager = new StateManager(gameArea, camera);

            base.Initialize();
        }