//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); }
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); }