Use the new builder instead and draw complexer forms
This commit is contained in:
parent
5f47726943
commit
e997cbae38
19
src/main.rs
19
src/main.rs
@ -1,5 +1,6 @@
|
|||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy_inspector_egui::Inspectable;
|
use bevy_inspector_egui::Inspectable;
|
||||||
|
use turtle_lib::builders::Turnable;
|
||||||
use turtle_lib::{get_a_turtle, TurtlePlugin};
|
use turtle_lib::{get_a_turtle, TurtlePlugin};
|
||||||
|
|
||||||
use bevy::diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin};
|
use bevy::diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin};
|
||||||
@ -19,11 +20,17 @@ fn main() {
|
|||||||
|
|
||||||
fn setup(mut commands: Commands) {
|
fn setup(mut commands: Commands) {
|
||||||
let mut turtle = get_a_turtle();
|
let mut turtle = get_a_turtle();
|
||||||
turtle.forward(10.);
|
let mut p = turtle.create_plan();
|
||||||
turtle.forward(10.);
|
for x in 0..1999 {
|
||||||
turtle.forward(10.);
|
p.forward(x.into());
|
||||||
turtle.forward(10.);
|
p.right(45.into());
|
||||||
turtle.forward(10.);
|
p.forward(30.into());
|
||||||
turtle.forward(10.);
|
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 {}));
|
commands.spawn((turtle, Egon {}));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user