From e997cbae389ec153fc49ef532988e5e8006b9638 Mon Sep 17 00:00:00 2001 From: Dietrich Date: Wed, 7 Dec 2022 13:55:17 +0100 Subject: [PATCH] Use the new builder instead and draw complexer forms --- src/main.rs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0cfecff..6408c79 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ use bevy::prelude::*; use bevy_inspector_egui::Inspectable; +use turtle_lib::builders::Turnable; use turtle_lib::{get_a_turtle, TurtlePlugin}; use bevy::diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}; @@ -19,11 +20,17 @@ fn main() { fn setup(mut commands: Commands) { let mut turtle = get_a_turtle(); - turtle.forward(10.); - turtle.forward(10.); - turtle.forward(10.); - turtle.forward(10.); - turtle.forward(10.); - turtle.forward(10.); + let mut p = turtle.create_plan(); + for x in 0..1999 { + p.forward(x.into()); + p.right(45.into()); + p.forward(30.into()); + p.left((90 + x).into()); + p.forward(30.into()); + p.right(45.into()); + p.forward(x.into()); + p.left(91.into()); + } + turtle.apply_plan(p); commands.spawn((turtle, Egon {})); }