normalizing angles to prevent drift
also move the at least one frame check to the AnimationSpeed creation.
This commit is contained in:
@@ -23,17 +23,17 @@ async fn main() {
|
||||
let mut plan = create_turtle();
|
||||
|
||||
// Position turtle
|
||||
plan.set_speed(1001);
|
||||
plan.pen_up();
|
||||
plan.backward(150.0);
|
||||
|
||||
plan.pen_down();
|
||||
plan.set_speed(10000);
|
||||
|
||||
// Draw Koch snowflake (triangle of Koch curves)
|
||||
for _ in 0..3 {
|
||||
koch(4, &mut plan, 300.0);
|
||||
plan.right(120.0);
|
||||
plan.set_speed(1000);
|
||||
plan.set_speed(1200);
|
||||
}
|
||||
|
||||
plan.hide(); // Hide turtle when done
|
||||
|
||||
@@ -8,10 +8,11 @@ async fn main() {
|
||||
// Create a turtle plan
|
||||
let mut plan = create_turtle();
|
||||
plan.shape(ShapeType::Turtle);
|
||||
plan.set_speed(800);
|
||||
plan.set_speed(1500);
|
||||
plan.set_pen_width(0.5);
|
||||
|
||||
// Draw a square
|
||||
for _ in 0..5 {
|
||||
// Draw a 5-pointed star pattern repeatedly
|
||||
for _i in 0..50000 {
|
||||
plan.forward(200.0);
|
||||
plan.circle_left(10.0, 72.0, 1000);
|
||||
plan.circle_right(5.0, 360.0, 1000);
|
||||
|
||||
Reference in New Issue
Block a user