prevent sprite offscreen