예제 #1
0
        public Player(Vec2F position, Vec2F extent)
        {
            player = new Entity(
                new DynamicShape(position, extent),
                new Image(Path.Combine("Assets", "Images", "Player.png")));

            GalagaBus.GetBus().Subscribe(GameEventType.PlayerEvent, this);
        }
예제 #2
0
        public Game()
        {
            win = new Window("Galaga", 500, AspectRatio.R1X1);

            eventBus = GalagaBus.GetBus();
            eventBus.InitializeEventBus(new List <GameEventType>()
            {
                GameEventType.InputEvent,
                GameEventType.WindowEvent,
                GameEventType.PlayerEvent,
                GameEventType.GameStateEvent
            });
            win.RegisterEventBus(eventBus);
            stateMachine = new StateMachine();
            gameTimer    = new GameTimer(60, 60);
            eventBus.Subscribe(GameEventType.InputEvent, this);
            eventBus.Subscribe(GameEventType.WindowEvent, this);
        }