Ejemplo n.º 1
0
        public static Entity CreateEntity()
        {
            var handle = World.CreateEntity();
            var entity = new Entity(handle);

            return(entity);
        }
Ejemplo n.º 2
0
#pragma warning restore CS8618

        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            _gameWorld = new GameWorld();
            _player    = _gameWorld.CreateEntity();
            _object    = _gameWorld.CreateEntity();

            _physicalWorld         = new PhysicalWorld();
            _physicalWorld.Gravity = Vector2.Zero;

            _resolutionIndependence = new ResolutionIndependentRenderer(this);
            _camera = new Camera2D(_resolutionIndependence);
            InitializeResolutionIndependence(_graphics.GraphicsDevice.Viewport.Width, _graphics.GraphicsDevice.Viewport.Height);

            base.Initialize();
        }