from manim import *
class SceneLifecycle(Scene):
    def construct(self):
        cap = Text("construct(): FadeIn -> shift -> FadeOut", font="Consolas",
                   font_size=30, color=BLUE).to_edge(UP, buff=0.6)
        dot = Dot(color=YELLOW).scale(1.6)
        self.play(FadeIn(cap), FadeIn(dot), run_time=0.8)
        self.play(dot.animate.shift(RIGHT * 3), run_time=1.2)
        self.wait(0.8)
        self.play(dot.animate.shift(LEFT * 3), run_time=1.0)
        self.play(FadeOut(dot), run_time=0.6)
        self.wait(1.2)
