Beispiel #1
0
        void InitSystems()
        {
            _engine = new Engine();

            _aiSystem           = new AIThinkSystem(_engine);
            _inputSystem        = new InputSystem(_engine);
            _paddleSystem       = new PaddleSystem(_engine);
            _ballMovementSystem = new BallMovementSystem(_engine);
            _goalSystem         = new GoalSystem(_engine);
            _livesSystem        = new LivesSystem(_engine);

            _renderSystem = new RenderSystem(GameManager.GraphicsDevice, _engine);

            _livesSystem.RegisterEventListeners();
        }
Beispiel #2
0
        public AIInputMethod()
        {
            engine     = new Engine();
            ballSystem = new BallMovementSystem(engine);

            ball          = engine.CreateEntity();
            ballTransform = new TransformComponent();
            ballComponent = new BallComponent(0);
            ball.AddComponent(ballTransform);
            ball.AddComponent(ballComponent);

            // Edges
            EdgeEntity.Create(engine, null, new Vector2(0, Constants.Pong.PLAYFIELD_HEIGHT / 2),
                              new Vector2(0, -1));
            EdgeEntity.Create(engine, null, new Vector2(0, -Constants.Pong.PLAYFIELD_HEIGHT / 2),
                              new Vector2(0, 1));
        }