matrix.py 文件源码

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

项目:hakkuframework 作者: 4shadoww 项目源码 文件源码
def tick(self, scr, steps):
        if self.step > WINDOW_SIZE:
            #stop window animation after some steps
            self.draw_frame(scr, self.x - self.step, self.y - self.step,
                            self.x + self.step, self.y + self.step,
                            curses.A_NORMAL)
            return False

        # clear all characters covered by the window frame
        for i in range(WINDOW_ANIMATION_SPEED):
            anistep = self.step + i
            self.draw_frame(scr, self.x - anistep, self.y - anistep,
                            self.x + anistep, self.y + anistep,
                            curses.A_NORMAL, ' ')
        #cancel last animation
        self.draw_frame(scr, self.x - self.step, self.y - self.step,
                        self.x + self.step, self.y + self.step,
                        curses.A_NORMAL)
        #next step
        self.step += WINDOW_ANIMATION_SPEED

        #draw outer frame
        self.draw_frame(scr, self.x - self.step, self.y - self.step,
                        self.x + self.step, self.y + self.step,
                        curses.A_REVERSE)
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号