コード例 #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()
        {
            _resources         = new ResourceManager(Content, new SpriteBatch(GraphicsDevice));
            _gameObjectFactory = new GameObjectFactory(_world);

            _level = new LevelOne();
            _level.Initialize(_gameObjectFactory);

            _player      = _gameObjectFactory.getPlayer();
            _player.Name = "Mr. Shizzle";

            _inputManager        = new InputManager(this);
            _inputManager.Player = _player;

            _cam = new Camera.Camera(new Vector2(0, 0), GraphicsDevice.Viewport);

            base.Initialize();
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: martinvium/xnaheist
        /// <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()
        {
            _resources = new ResourceManager(Content, new SpriteBatch(GraphicsDevice));
            _gameObjectFactory = new GameObjectFactory(_world);

            _level = new LevelOne();
            _level.Initialize(_gameObjectFactory);

            _player = _gameObjectFactory.getPlayer();
            _player.Name = "Mr. Shizzle";

            _inputManager = new InputManager(this);
            _inputManager.Player = _player;

            _cam = new Camera.Camera(new Vector2(0, 0), GraphicsDevice.Viewport);

            base.Initialize();
        }
コード例 #3
0
ファイル: CameraManager.cs プロジェクト: martinvium/xnaheist
 internal void GetCamera(Vector2 position, Viewport viewport)
 {
     _camera = new Camera(position, viewport);
 }