public GameController(PacManWindow pacManWindow, Timer timer) { PacManWindow = pacManWindow; Level = 0; NextLevel(); Score = new Score(this); Footer = new Footer(this); this.timer = timer; SizeMap = new Size(Map.WidthCountCell * Map.LENGTH_CELL, Map.HeightCountCell * Map.LENGTH_CELL); timer.Tick += TimerTick; CreateCreatures(Map); }
public Map(char[,] charFields, char[,] charDots, PacManWindow pacManWindow) { PacManWindow = pacManWindow; WidthCountCell = charFields.GetLength(1); HeightCountCell = charFields.GetLength(0); SizeCountCells = new Size(WidthCountCell, HeightCountCell); InitMapFields(charFields); foreach (IField mapField in MapFields) { if (mapField is SpawnField) { bases.Add(new Position(mapField.Y, mapField.X)); } if (mapField is FruitField field) { fruitFields.Add(field); } } MapDots = new MapDots(charDots, this); }
public void NextLevel() { Map = PacManWindow.ClearMap(); Level++; }