from manim import *
def dot(pos, **kwargs):
    """简写，等价于 Dot(pos, **kwargs)"""
    return Dot(pos, **kwargs)
class LaggedStartDemo(Scene):
    def construct(self):
        sc = self
        d1 = dot(LEFT * 2 + UP, color=RED)
        d2 = dot(LEFT * 2 + DOWN)
        dl = DashedLine(
            RIGHT * 2 + UP * 3,
            RIGHT * 2 + DOWN * 3,
            dash_length=0.1,
            dashed_ratio=0.8,
            stroke_width=2,
            color=GREEN,
        )
        self.play(*[FadeIn(_o) for _o in [d1, d2, dl]], run_time=1.0)
        sc.wait(0.5)
        ani1 = d1.animate(run_time=1).shift(RIGHT * 4)
        ani2 = d2.animate(run_time=0.5).shift(RIGHT * 4)
        sc.play(LaggedStart(ani1, ani2, lag_ratio=0.5))
        self.wait(0.5)
        self.wait(2.60)