Ejemplo n.º 1
0
        public override void Initialize()
        {
            var directionsEntity = Entities.CreateEntity();

            directionsEntity.AddComponent(new PositionComponent(50, 400));
            directionsEntity.AddComponent(new TextureComponent(_directionsTexture));

            var playerEntity = Entities.CreateEntity();

            playerEntity.AddComponent(new PositionComponent(50, 50));
            playerEntity.AddComponent(new MovementComponent(0, 0));
            playerEntity.AddComponent(new PlayerFlagComponent());
            playerEntity.AddComponent(new TextureComponent(_playerTexture));

            for (var i = 0; i < 5; i++)
            {
                AddBox();
            }

            Systems.AddSystem(new PlayerInputSystem());
            Systems.AddSystem(new MovementSystem());
            Systems.AddSystem(new BounceNotifySystem());
            Systems.AddSystem(new BoxAddSystem(_boxTexture, _rand));

            Systems.AddSystem(new RenderSystem());
        }
Ejemplo n.º 2
0
        public override void Initialize()
        {
            var clickEntity = Entities.CreateEntity();

            clickEntity.AddComponent(new PositionComponent(100, 100));
            clickEntity.AddComponent(new TextureComponent(_clickTexture));

            Systems.AddSystem(new StartListenSystem());

            Systems.AddSystem(new RenderSystem());
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 注册系统
 /// </summary>
 /// <param name="system"></param>
 public void SubscribeSystem(IExcuteSystem system)
 {
     _systems.AddSystem(system);
 }
 public void AddSystem(IGraphicSystem sys)
 {
     Systems.AddSystem(sys);
 }