static void Main(string[] args) { Plansza plansza = new Plansza(); PacMan pacman = new PacMan(plansza); ConsoleKeyInfo cki = new ConsoleKeyInfo(); while (true) { while (Console.KeyAvailable == false) { Console.Clear(); //punkt.ruch(cki); pacman.ruch(cki, ref plansza); plansza.generowanieTablicy(ref pacman); Console.WriteLine("\nPunkt x {0} punkt y {1}", pacman.x, pacman.y); Console.WriteLine("Punkty: {0}", pacman.score); Thread.Sleep(300); } cki = Console.ReadKey(); } Console.ReadLine(); }
static void GeneratePacMan() { int row = 13; int col = 23; pacMan = new PacMan(row, col); }
static void GeneratePacMan() { int row = 13; int col = 5; pacMan = new PacMan(row, col, ConsoleColor.Yellow); }
public void generowanieTablicy(ref PacMan pkt) { for (int i = 0; i < 14; i++) { for (int j = 0; j < 17; j++) { if (pkt.y == i && pkt.x == j) { planszaTab[i, j] = '@'; } } } wyswietlPlanszeZPliku(); }
/// <summary> /// Creates new instance of PacMan /// </summary> private static void GeneratePacMan() { pacMan = new PacMan(); }