def generate_random_number(self): morty = self.morty bubble = morty.get_bubble("", direction=LEFT) numbers = [Integer(random.choice(range(100))) for x in range(30)] numbers.append(Integer(67)) for number in numbers: number.next_to(morty, UP, LARGE_BUFF, RIGHT) for number in numbers: self.add(number) Scene.wait(self, 0.1) self.remove(number) self.play( ShowCreation(bubble), number.move_to, bubble.get_bubble_center(), DOWN + LEFT, morty.change, "pondering", ) self.wait() morty.bubble = bubble self.number = number
def non_blink_wait(self, time=1): Scene.wait(self, time) return self