private void CheckRecyclePlatform() { float x = Platforms[0].BoundingBox.Center.X; float newX = float.MinValue; Platform newPlatform = null; if (movementDirection == MovementDirections.LEFT) { if (x <= -OFFSCREEN_DISTANCE) { newX = x + totalLength; } } else { if (x >= Constants.SCREEN_WIDTH + OFFSCREEN_DISTANCE) { newX = x - totalLength; } } if (newX != float.MinValue) { newPlatform = new Platform(new Vector2(newX, yValue), Hazards.HazardTypes.NONE, true); Platforms[0].Destroy(); Platforms.RemoveAt(0); Platforms.Add(newPlatform); PlatformMasterList.Add(newPlatform); } }