Exemplo n.º 1
0
        public void Start()
        {
            l = new Labirint();
            SerDeserTemlate <Labirint> .Serialize(@"C:\Users\Маргарита\Desktop\Курсовой\Resources\Serialize.txt", l);

            SerDeserTemlate <Labirint> .Deserialize(@"C:\Users\Маргарита\Desktop\Курсовой\Resources\Serialize.txt");

            gamer1 = new Pacman(l, new Vector2D(1, 1));
            ghosts = new Dictionary <string, Unit>
            {
                { "blinky", new Blinky(l, gamer1, l.startPoint["blinky"]) },
                { "pinky", new Pinky(l, gamer1, l.startPoint["pinky"]) },
                { "inky", new Inky(l, gamer1, l.startPoint["inky"]) },
                { "clyde", new Clyde(l, gamer1, l.startPoint["clyde"]) }
            };
            int count = 0;

            l.Show();
            while (!IsLose())
            {
                if (count > 10)
                {
                    l.OpenGate();
                }
                DoStep();
                Show();
                count++;
                if (IsWin())
                {
                    Console.WriteLine("You win!!!");
                    break;
                }
            }
        }
Exemplo n.º 2
0
 public Clyde(Labirint l, Pacman p, Vector2D position) : base(l, position)
 {
     this.p = p;
 }
Exemplo n.º 3
0
 public Clyde(Labirint l, Pacman p) : this(l, p, new Vector2D())
 {
 }
Exemplo n.º 4
0
 public Unit(Labirint l, Vector2D position, Direction direction)
 {
     this.l = l;
     this.previousPosition  = this.position = position;
     this.previousDirection = this.direction = direction;
 }
Exemplo n.º 5
0
 public Unit(Labirint l, Vector2D position) : this(l, position, Direction.NULL)
 {
 }
Exemplo n.º 6
0
 public Pinky(Labirint l, Pacman p) : this(l, p, new Vector2D())
 {
 }
Exemplo n.º 7
0
 public Blinky(Labirint l, Pacman p, Vector2D position) : base(l, position)
 {
     this.p = p;
 }
Exemplo n.º 8
0
 public Pacman(Labirint l, Vector2D position, Direction direction) : base(l, position, direction)
 {
 }
Exemplo n.º 9
0
 public Pacman(Labirint l, Vector2D position) : this(l, position, Direction.NULL)
 {
 }