示例#1
0
        //returns true if it collides with another platform
        public bool CollidesWithOtherPlatform()
        {
            bool collided = false;

            foreach (Platform platform in PlayingState.GetPlatforms())
            {
                if (CollidesWith(platform))
                {
                    collided = true;
                }
            }
            return(collided);
        }
示例#2
0
        private bool CollidesWithPlatform(out float collidedY)
        {
            bool collided = false;

            collidedY = 0;
            foreach (Platform platform in PlayingState.GetPlatforms())
            {
                if (CollidesWith(platform))
                {
                    collided  = true;
                    collidedY = platform.Position.Y;
                }
            }
            return(collided);
        }