public void SetLevel2() { player = new Player("1 0"); field = new Field(3, 4); obsticales = new Obsticales(new List <string>() { "2 0", "0 3", "1 3" }); boxes = new Boxes ( new List <string>() { "1 1", "1 2" }, new List <string>() { "2 2", "2 3" } ); _display = new Display(); _display.DisplayLevel(currLevel); _display.DisplayField(field, player, obsticales, boxes); Play(); SetLevel3(); }
public void SetLevel3() { player = new Player("3 4"); field = new Field(6, 8); obsticales = new Obsticales(new List <string>() { "0 0", "1 0", "2 0", "3 0", "2 1", "3 1", "2 3", "3 3", "2 5", "3 5", "2 7", "3 7", "1 7", "0 7", "0 6", "0 5", "5 3", "5 4" }); boxes = new Boxes ( new List <string>() { "1 2", "2 2", "1 5" }, new List <string>() { "4 1", "4 3", "4 5" } ); _display = new Display(); _display.DisplayLevel(currLevel); _display.DisplayField(field, player, obsticales, boxes); Play(); _display.Congrats(); }
public void StartUp() { player = new Player("0 0"); field = new Field(5, 5); obsticales = new Obsticales(new List <string>() { "0 3", "1 3", "2 3", "2 2" }); boxes = new Boxes ( new List <string>() { "2 0", "2 1" }, new List <string>() { "4 0", "3 3" } ); _display = new Display(); _display.DisplayLevel(currLevel); _display.DisplayField(field, player, obsticales, boxes); Play(); SetLevel1(); }
public void DisplayField(Field field, Player player, Obsticales obsticales, Boxes boxes) { string currCoordinate = ""; for (int col = 0; col < field.Cols + 2; col++) { Console.Write("▒ "); } Console.WriteLine(); for (int row = 0; row < field.Rows; row++) { Console.Write("▒ "); for (int col = 0; col < field.Cols; col++) { currCoordinate = row + " " + col; if (currCoordinate == player.Coordinates) { Console.Write("& "); } else if (boxes.BoxCoordinates.Contains(currCoordinate)) { Console.Write("# "); } else if (boxes.GoalCoordinates.Contains(currCoordinate)) { Console.Write("X "); } else if (obsticales.Coordinates.Contains(currCoordinate)) { Console.Write("▒ "); } else { Console.Write(" "); } } Console.Write("▒ "); Console.WriteLine(); } for (int col = 0; col < field.Cols + 2; col++) { Console.Write("▒ "); } }