Example #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;
                }
            }
        }
Example #2
0
 public Clyde(Labirint l, Pacman p, Vector2D position) : base(l, position)
 {
     this.p = p;
 }
Example #3
0
 public Clyde(Labirint l, Pacman p) : this(l, p, new Vector2D())
 {
 }
Example #4
0
 public Unit(Labirint l, Vector2D position, Direction direction)
 {
     this.l = l;
     this.previousPosition  = this.position = position;
     this.previousDirection = this.direction = direction;
 }
Example #5
0
 public Unit(Labirint l, Vector2D position) : this(l, position, Direction.NULL)
 {
 }
Example #6
0
 public Pinky(Labirint l, Pacman p) : this(l, p, new Vector2D())
 {
 }
Example #7
0
 public Blinky(Labirint l, Pacman p, Vector2D position) : base(l, position)
 {
     this.p = p;
 }
Example #8
0
 public Pacman(Labirint l, Vector2D position, Direction direction) : base(l, position, direction)
 {
 }
Example #9
0
 public Pacman(Labirint l, Vector2D position) : this(l, position, Direction.NULL)
 {
 }