initial multi-turtle support
This commit is contained in:
@@ -71,7 +71,7 @@ async fn main() {
|
||||
|
||||
println!("Building and executing turtle plan...");
|
||||
// Execute the plan
|
||||
let mut app = TurtleApp::new().with_commands(turtle.build());
|
||||
let mut app = TurtleApp::new().with_commands(0, turtle.build());
|
||||
|
||||
loop {
|
||||
clear_background(Color::new(0.95, 0.95, 0.98, 1.0));
|
||||
|
||||
@@ -111,7 +111,7 @@ async fn main() {
|
||||
// Set animation speed
|
||||
t.set_speed(500);
|
||||
|
||||
let mut app = TurtleApp::new().with_commands(t.build());
|
||||
let mut app = TurtleApp::new().with_commands(0, t.build());
|
||||
|
||||
let target_fps = 1.0; // 1 frame per second for debugging
|
||||
let frame_time = 1.0 / target_fps;
|
||||
|
||||
@@ -75,7 +75,7 @@ async fn main() {
|
||||
t.set_speed(100); // Slow animation to see the logs in real-time
|
||||
|
||||
// Create turtle app
|
||||
let mut app = TurtleApp::new().with_commands(t.build());
|
||||
let mut app = TurtleApp::new().with_commands(0, t.build());
|
||||
|
||||
// Main loop
|
||||
loop {
|
||||
|
||||
@@ -4,7 +4,7 @@ use turtle_lib::*;
|
||||
|
||||
#[turtle_main("Yin-Yang")]
|
||||
fn draw(turtle: &mut TurtlePlan) {
|
||||
turtle.set_speed(200);
|
||||
turtle.set_speed(100);
|
||||
|
||||
turtle.circle_left(90.0, 180.0, 36);
|
||||
turtle.begin_fill();
|
||||
|
||||
Reference in New Issue
Block a user