Esempio n. 1
0
        public void Launch()
        {
            Game = MakeGame();
            PacManUiBuilder builder = new PacManUiBuilder().withDefaultButtons();

            AddSinglePlayerKeys(builder, Game);
            pacManUI = builder.build(Game);
            pacManUI.start();
        }
Esempio n. 2
0
        protected void AddSinglePlayerKeys(PacManUiBuilder builder,
                                           Game game)
        {
            Player p1 = GetSinglePlayer(game);

            builder.addKey(Keys.Up, () => game.Move(p1, Direction.NORTH))
            .addKey(Keys.Down, () => game.Move(p1, Direction.SOUTH))
            .addKey(Keys.Left, () => game.Move(p1, Direction.WEST))
            .addKey(Keys.Right, () => game.Move(p1, Direction.EAST));
        }