コード例 #1
0
ファイル: SpaceBattleMain.cs プロジェクト: ivan-yosifov/Game
        static void Main()
        {
            IRenderer  renderer   = new ConsoleRenderer(WorldRows, WorldCols);
            IUserInput keyboard   = new KeyboardInput();
            Engine     gameEngine = new Engine(renderer, keyboard);

            keyboard.OnLeftPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerAircraftLeft();
            };

            keyboard.OnRightPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerAircraftRight();
            };

            keyboard.OnActionPressed += (sender, eventInfo) =>
            {
                gameEngine.AircraftShoot();
            };


            Initialize(gameEngine);
            gameEngine.Run();
        }