Movement of rectangle overlapping triangle