Beispiel #1
0
        public PlayerControllerSystem(World world) : base(world)
        {
            ecsContext     = world;
            horizontalAxis = new VirtualIntegerAxis();
            horizontalAxis.AddKeyboardKeys(VirtualInput.OverlapBehavior.CancelOut, Keys.A, Keys.D);

            verticalAxis = new VirtualIntegerAxis();
            verticalAxis.AddKeyboardKeys(VirtualInput.OverlapBehavior.CancelOut, Keys.S, Keys.W);

            shootButton = new VirtualButton();
            shootButton.AddMouseLeftButton();
        }
Beispiel #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();
        }
Beispiel #3
0
 public static void Init()
 {
     World    = new ECSWorld();
     Entities = new Dictionary <DefaultEcs.Entity, Entity>();
 }
 public PlayerBodyGenerator(FarseerPhysics.Dynamics.World physicsWorld, DefaultEcs.World world) : base(physicsWorld, world)
 {
 }
 public TriggerResolveSystem(World world)
 {
     ecsContext = world;
     ecsContext.Subscribe(this);
     collisions = new ConcurrentQueue <ICollision>();
 }
 public ConstructBodyGenerator(FarseerPhysics.Dynamics.World physicsWorld, DefaultEcs.World world) : base(physicsWorld, world)
 {
 }