implemented sprite clipping