def dropAnim(self, fall):
# Animace padání bloku
if fall:
d = .1
else:
d= .2
boxes = []
for box in self.shape[self.orientation]:
if ((box[0] >= 0) and (box[0] <= 11)) and ((box[1] >= 0) and (box[1] <= 21)):
cur = self.get(box[0], box[1])
a = Box()
a.size = cur.size
a.pos = cur.pos
a.colored = cur.colored
a.size_hint = (None, None)
boxes.append(a)
self.app.sOverlay.add_widget(a)
if len(boxes) != 0:
anims = [Animation(y=p.y-p.size[1], opacity=0., t='linear', d=d) for p in boxes]
for i in range(len(boxes)):
anims[i].start(boxes[i])
Clock.schedule_once(self.clearAnimation, d)
评论列表
文章目录