public EditorLevel(TileField tileField, int levelindex = 0, Point?screenSize = null) { start = new Point(1, 1); numRows = tileField.Rows; numColumns = tileField.Columns; Tiles = tileField; Tiles.UpdateGraphicsToMatchSurroundings(); Tiles.FogOfWar = false; usePlayer(new EditorPlayer(this, start)); Camera.SetScreenSize(screenSize); }
public static void FillWithEmptyTiles(TileField tf) { for (int x = 0; x < tf.Columns; x++) { for (int y = 0; y < tf.Rows; y++) { if (tf.OnEdgeOfTileField(x, y)) { tf.Add(new WallTile(), x, y); } else { tf.Add(new FloorTile(), x, y); } } } tf.UpdateGraphicsToMatchSurroundings(); }
public PlayingLevel(TileField tileField, int levelindex = 0, int playerIndex = 0, int playerDifficulty = 0) { start = tileField.Start; numRows = tileField.Rows; numColumns = tileField.Columns; Tiles = tileField; Tiles.UpdateGraphicsToMatchSurroundings(); Tiles.UpdatePortals(); switch (playerIndex) { case 0: UseHumanPlayer(); break; case 1: UseRandomWalkingAIPlayer(); break; case 2: try { UseAStarAIPlayer(); } catch (Exception e) { goto default; } break; case 3: UseMonteCarloAIPlayer(); break; case 4: UseFloodFillAIPlayer(); break; default: UseHumanPlayer(); break; } }