예제 #1
0
 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);
 }
예제 #2
0
파일: Map.cs 프로젝트: hackerdmitry/PacMan
 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);
 }
예제 #3
0
 public void NextLevel()
 {
     Map = PacManWindow.ClearMap();
     Level++;
 }