示例#1
0
 /// <summary>
 /// Controls Ghosts trough Input and manages it's own list.
 /// </summary>
 public Player()
 {
     for (int i = 0; i < 3; i++)
     {
         myGhosts[0][i] = new RedGhost(this);
         myGhosts[1][i] = new BlueGhost(this);
         myGhosts[2][i] = new YellowGhost(this);
     }
 }
示例#2
0
        public int[] door;  // coordinates of the door to ghosts' home

        public GamePlan(string pathToMap, int dotPoints, int ghostPoints, int[] redStart, int[] redHome, int[] pinkStart, int[] pinkHome,
                        int[] blueStart, int[] blueHome, int[] yellowStart, int[] yellowHome)
        {
            // reads map from file and creates 4 ghosts according to initial data
            // redStart - coordinates of the red ghost starting tile
            // redHome - coordinates of the red ghost home - tile where it goes in Scatter mode
            ReadMapFromFile(pathToMap);
            this.dotPoints   = dotPoints;
            this.ghostPoints = ghostPoints;
            this.curPoints   = 0;
            dotsEaten        = 0;
            livesLeft        = Global.MAXLIVES;
            RedGhost    red    = new RedGhost(redStart[0], redStart[1], this, GhostMode.Chase, redHome[0], redHome[1]);
            PinkGhost   pink   = new PinkGhost(pinkStart[0], pinkStart[1], this, GhostMode.Wait, pinkHome[0], pinkHome[1]);
            BlueGhost   blue   = new BlueGhost(blueStart[0], blueStart[1], this, GhostMode.Wait, blueHome[0], blueHome[1]);
            YellowGhost yellow = new YellowGhost(yellowStart[0], yellowStart[1], this, GhostMode.Wait, yellowHome[0], yellowHome[1]);

            ghosts = new Ghost[] { red, pink, blue, yellow };
        }