class Thing(object):
    """Generic game object with interpolation"""

def __init__(self, x=0, y=0):
    self._x = self.x = x
self._y = self.y = y

def imprint(self):
    """call before changing x and y"""
self._x = self.x
self._y = self.y

def __iter__(self):
    """handy to unpack like a tuple"""
yield self.x
yield self.y
Ship = Thing
Bullet = Thing


class Star(Thing):
    """docstring for Star"""

def __init__(self, x, y, r):
    super(Star, self).__init__(x, y)
self.r = r

def __iter__(self):
    yield self.x
yield self.y
yield self.r

def lerp_things(things, alpha, threshold=100):
    """Expects iterables of Things"""
for t in things:
    if sqrt((t._x - t.x) ** 2 + (t._y - t.y) ** 2) > threshold:
        yield t.x, t.y
else:
    yield lerp(t._x, t.x, alpha), lerp(t._y, t.y, alpha)
Как бы вы справились с интерполяцией в игре на питоне?