Moved distance calculation to sprite