public static bool IsRightOf(ref Rectangle player, Rectangle box, ref Vector2 velocity, ref Vector2 playerPosition, bool positionBoxes = true) { bool rtn = player.IsRightOf(box, velocity); if (positionBoxes && rtn) { velocity.X = 0; playerPosition.X = box.Right; player.X = (int)playerPosition.X; } return rtn; }