/// <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()
        {
            _scaler = new RenderTargetScaler(this, _graphics, ScreenWidth, ScreenHeight);

            // create the title screen
            SetState(GameState.TitleScreen);

            base.Initialize();
        }
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()
        {
            _scaler = new RenderTargetScaler(this, _graphics, ScreenWidth, ScreenHeight);

            _spriteBatch = new SpriteBatch(GraphicsDevice);

            _player             = new Player();
            PlayerStartPosition = new Vector2(ScreenWidth / 2 - _player.Width / 2, ScreenHeight - 120);
            _player.Position    = PlayerStartPosition;

            _enemyGroup = new EnemyGroup();

            _playerShots = new List <PlayerShot>();

            TouchPanel.EnabledGestures = GestureType.Tap | GestureType.HorizontalDrag;

            base.Initialize();
        }