コード例 #1
0
 public GameObject getGameObject()
 {
     GameObject creature = new GameObject();
     _gameObjects.Add(creature);
     return creature;
 }
コード例 #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();
        }