updated sprite collision logic