Exemple #1
0
        /// <summary>
        /// Constructor instantiates the gamestate, the location, the target, the ghoststate and color
        /// of the ghost.
        /// </summary>
        public Ghost(GameState g, int x, int y, GhostState start, Color colour, GhostName name)
        {
            this.colour   = colour;
            this.pen      = g.Pen;
            this.maze     = g.Maze;
            this.pacman   = g.Pacman;
            this.position = new Vector2(x, y);
            this.name     = name;

            ChangeState(start);
        }
Exemple #2
0
        public Ghost(Texture2D spritesheet, GhostName name, int xPos, int yPos, GhostState startState) : base(spritesheet, 8, 8, xPos, yPos)
        {
            _name              = name;
            _scatterElapsed    = 0.0f;
            _chaseElapsed      = 0.0f;
            _frightenedElapsed = 0.0f;

            _cagedLength  = 1.5f;
            _cagedElapsed = 0.0f;

            _blinkLength = 0.4f;
            _numBlinks   = 4;

            _homeXPixel = -1;
            _homeYPixel = -1;

            _startPosX  = xPos;
            _startPosY  = yPos;
            _startState = startState;
            State       = startState;
        }