def handleEvent(self, event, clock):
if event.type == pygame.MOUSEBUTTONDOWN:
# move sprite to clicked location using interpolator
fps = clock.get_fps()
x, y = event.pos
self.line = Interpolator(
self.rect.center,
(x, y),
0.5, # duration of interpolation
fps, # current frames per second
1.0, # type of interpolation
0.5 # middle?
)
self.dirty = 1
评论列表
文章目录