(scene)
| 8 | |
| 9 | @frames_comparison(last_frame=False) |
| 10 | def test_SpeedModifier(scene): |
| 11 | a = Dot().shift(LEFT * 2 + 0.5 * UP) |
| 12 | b = Dot().shift(LEFT * 2 + 0.5 * DOWN) |
| 13 | c = Dot().shift(2 * RIGHT) |
| 14 | ChangeSpeed.add_updater(c, lambda x, dt: x.rotate_about_origin(PI / 3.7 * dt)) |
| 15 | scene.add(a, b, c) |
| 16 | scene.play(ChangeSpeed(Wait(0.5), speedinfo={0.3: 1, 0.4: 0.1, 0.6: 0.1, 1: 1})) |
| 17 | scene.play( |
| 18 | ChangeSpeed( |
| 19 | AnimationGroup( |
| 20 | a.animate(run_time=0.5, rate_func=linear).shift(RIGHT * 4), |
| 21 | b.animate(run_time=0.5, rate_func=rush_from).shift(RIGHT * 4), |
| 22 | ), |
| 23 | speedinfo={0.3: 1, 0.4: 0.1, 0.6: 0.1, 1: 1}, |
| 24 | affects_speed_updaters=False, |
| 25 | ), |
| 26 | ) |
| 27 | scene.play( |
| 28 | ChangeSpeed( |
| 29 | AnimationGroup( |
| 30 | a.animate(run_time=0.5, rate_func=linear).shift(LEFT * 4), |
| 31 | b.animate(run_time=0.5, rate_func=rush_into).shift(LEFT * 4), |
| 32 | ), |
| 33 | speedinfo={0.3: 1, 0.4: 0.1, 0.6: 0.1, 1: 1}, |
| 34 | rate_func=there_and_back, |
| 35 | ), |
| 36 | ) |
nothing calls this directly
no test coverage detected