CONST Delta = 0.4; CONST Width = 130; CONST FootSize = 130; CONST Weight = 2; CONST Beat = 0.75; PROC ChaChaCha(a, b, c, d, f, e) IS Anim.Play(Anim.Co(Count(SolidRightFoot, d, Beat, "1"), MoveArc(LeftFoot, b, c, e, Beat))); Anim.Play(Anim.Co(Hold(RightFoot, d, Beat), Count(SolidLeftFoot, e, Beat, "2"))); Anim.Play(Anim.Co(Count(SolidRightFoot, d, Beat, "3"), MoveArc(LeftFoot, e, c, b, 1 * Beat))); Anim.Play(Anim.Co(Count(SolidLeftFoot, b, 0.5 * Beat, "4"), MoveStraight(RightFoot, d, c, 0.5 * Beat))); Anim.Play(Anim.Co(Count(SolidRightFoot, c, 0.5 * Beat, "&"), MoveStraight(LeftFoot, b, a, 0.5 * Beat))); Anim.Play(Anim.Co(Count(SolidLeftFoot, a, Beat, "1"), MoveArc(RightFoot, c, b, f, Beat))); Anim.Play(Anim.Co(Hold(LeftFoot, a, Beat), Count(SolidRightFoot, f, Beat, "2"))); Anim.Play(Anim.Co(Count(SolidLeftFoot, a, Beat, "3"), MoveArc(RightFoot, f, b, c, Beat))); Anim.Play(Anim.Co(Count(SolidRightFoot, c, 0.5 * Beat, "4"), MoveStraight(LeftFoot, a, b, 0.5 * Beat))); Anim.Play(Anim.Co(Count(SolidLeftFoot, b, 0.5 * Beat, "&"), MoveStraight(RightFoot, c, d, 0.5 * Beat))) END; PROC an := MoveStraight(foot, p, q, dur) IS an := (CLOSE(StraightFrame, foot, p, q, dur), dur) END; PROC StraightFrame(foot, p, q, dur, t) IS VAR r IN r := (t / dur, 0) REL (p, q); APPLY(foot, r) END END; PROC an := Hold(foot, p, dur) IS an := MoveStraight(foot, p, p, dur) END; PROC an := Count(foot, p, dur, txt) IS an := MoveStraight(CLOSE(foot, txt), p, p, dur) END; PROC an := MoveArc(foot, p, q, r, dur) IS an := (CLOSE(ArcFrame, foot, p, q, r, dur), dur) END; PROC ArcFrame(foot, p, q, r, dur, t) IS VAR pq, qr, pqr IN pq := (t / dur, 0) REL (p, q); qr := (t / dur, 0) REL (q, r); pqr := (t / dur, 0) REL (pq, qr); APPLY(foot, pqr) END END; PROC LeftFoot(p) IS LeftFoot2(p, R2.Plus(p, (0, FootSize))); PS.SetWidth(Weight); PS.Stroke() END; PROC RightFoot(p) IS RightFoot2(p, R2.Plus(p, (0, FootSize))); PS.SetWidth(Weight); PS.Stroke() END; PROC SolidLeftFoot(txt, p) IS LeftFoot3(txt, p, R2.Plus(p, (0, FootSize))); PS.SetWidth(Weight); PS.Stroke() END; PROC SolidRightFoot(txt, p) IS RightFoot3(txt, p, R2.Plus(p, (0, FootSize))); PS.SetWidth(Weight); PS.Stroke() END; PROC LeftFoot2(p, q) IS IF VAR a = (0.4607, 0.09437) REL (q, p), b ~ (0.2622, 0.1553) REL (q, p), c ~ (0.15, 0.1607) REL (q, p), d = (0.04806, 0.09659) REL (q, p), e ~ (-0.05393, 0.03251) REL (q, p), f ~ (0.01538, -0.1077) REL (q, p), g = (0.1995, -0.1588) REL (q, p), h ~ (0.3837, -0.2098) REL (q, p), i ~ (0.7751, -0.1291) REL (q, p), j = (0.9134, -0.09485) REL (q, p), k ~ (1.052, -0.06059) REL (q, p), l ~ (1.031, 0.09231) REL (q, p), m = (0.8593, 0.095) REL (q, p), n ~ (0.6879, 0.0977) REL (q, p), o ~ (0.6593, 0.03347) REL (q, p) IN TRUE OR a = Geometry.Mid(o, b) AND j = Geometry.Mid(i, k) AND m = Geometry.Mid(n, l) AND g = Geometry.Mid(h, f) AND d = Geometry.Mid(e, c) -> PS.MoveTo(a); PS.CurveTo(b, c, d); PS.CurveTo(e, f, g); PS.CurveTo(h, i, j); PS.CurveTo(k, l, m); PS.CurveTo(n, o, a); PS.Close() END FI END; PROC RightFoot2(p, q) IS IF VAR a = (0.4607, -0.09437) REL (q, p), b ~ (0.2622, -0.1553) REL (q, p), c ~ (0.15, -0.1607) REL (q, p), d = (0.04806, -0.09659) REL (q, p), e ~ (-0.05393, -0.03251) REL (q, p), f ~ (0.01538, --0.1077) REL (q, p), g = (0.1995, --0.1588) REL (q, p), h ~ (0.3837, --0.2098) REL (q, p), i ~ (0.7751, --0.1291) REL (q, p), j = (0.9134, --0.09485) REL (q, p), k ~ (1.052, --0.06059) REL (q, p), l ~ (1.031, -0.09231) REL (q, p), m = (0.8593, -0.095) REL (q, p), n ~ (0.6879, -0.0977) REL (q, p), o ~ (0.6593, -0.03347) REL (q, p) IN TRUE OR a = Geometry.Mid(o, b) AND j = Geometry.Mid(i, k) AND m = Geometry.Mid(n, l) AND g = Geometry.Mid(h, f) AND d = Geometry.Mid(e, c) -> PS.MoveTo(a); PS.CurveTo(b, c, d); PS.CurveTo(e, f, g); PS.CurveTo(h, i, j); PS.CurveTo(k, l, m); PS.CurveTo(n, o, a); PS.Close() END FI END; PROC LeftFoot3(txt, a, b) IS VAR c IN c := (0.318, 0) REL (b, a); LeftFoot2(a, b); PS.SetFontSize(PS.Huge); PS.SetFontFace("Helvetica"); Type.C(c, txt) END END; PROC RightFoot3(txt, a, b) IS IF VAR c ~ (0.318, 0) REL (b, a) IN TRUE OR (a, c) PARA (a, b) -> RightFoot2(a, b); PS.SetFontSize(PS.Huge); PS.SetFontFace("Helvetica"); Type.C(c, txt) END FI END; CONST Origin = R2.Minus(R2.Origin, (70, 70)); PROC ChaChaTwice() IS IF VAR a = Origin, b ~ (0.3333, 0) REL (a, d), c ~ (0.6667, 0) REL (a, d), d ~ R2.Plus(a, (Width, 0)), e ~ (0.6667, 0.7572) REL (a, d), f ~ (0.3333, -0.7572) REL (a, d) IN TRUE -> Anim.Play(Anim.Co(Hold(LeftFoot, b, Beat), Count(SolidRightFoot, d, Beat, "3"))); Anim.Play(Anim.Co(Hold(LeftFoot, b, Beat), Count(SolidRightFoot, d, Beat, "4"))); ChaChaCha(a, b, c, d, f, e); ChaChaCha(a, b, c, d, f, e); Anim.Play(Anim.Co(Count(SolidLeftFoot, b, Beat, "&"), Count(SolidRightFoot, d, Beat, "1"))) END FI END; UI PointTool(Go); PROC Go() IS Anim.Play((Title("Cha Cha"), 2 * Beat)); Anim.Play((Title(""), 0.5 * Beat)); Anim.Play((Title("Basic step"), 2 * Beat)); Anim.Play((Title(""), 0.5 * Beat)); Anim.Play((Title("Man's part"), 2 * Beat)); Anim.Play((Title(""), 0.5 * Beat)); ChaChaTwice() END; PROC res := Title(txt) IS res := CLOSE(TitleFrame, txt) END; PROC TitleFrame(txt, t) IS PS.SetFontSize(PS.Huge); PS.SetFontFace("Helvetica"); TypeLinesC.South(center, txt) END; VAR center := R2.Origin;