Ejemplo n.º 1
0
        /// <summary>
        /// Adds the platform to our list of connections if it intersects the command.
        /// </summary>
        /// <param name="p"></param>
        public void ConnectToPlatform(Platform p)
        {
            switch (type)
            {
                case CommandType.Jump:
                    return;
                case CommandType.MoveLeft:
                    return;
                case CommandType.MoveRight:
                    return;
                case CommandType.ObjectThrow:
                    return;
            }

            if (!Contains(p.drawRect)) return;

            ConnectedPlatforms.AddLast(p);
            patrol = p.GetPatrol();
            FacesLeft = Center().X < p.Center().X;
            p.Flash();
        }