public void Launch() { Game = MakeGame(); PacManUiBuilder builder = new PacManUiBuilder().withDefaultButtons(); AddSinglePlayerKeys(builder, Game); pacManUI = builder.build(Game); pacManUI.start(); }
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)); }