box.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:Mobile-TetriNET 作者: Smug28 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号