예제 #1
0
        /// <summary>
        /// Adds the platform to our list of connections if it intersects the command.
        /// </summary>
        /// <param name="p"></param>
        public bool ConnectToPlatform(Platform p)
        {
            if (!Contains(p.DrawFrame())) return false;

            if (type == CommandType.Jump || type == CommandType.MoveLeft || type == CommandType.MoveRight || type == CommandType.ObjectThrow) return false;

            ConnectedPlatforms.AddLast(p);
            FacesLeft = GetCenter().X < p.GetCenter().X;
            return true;
        }