initial multi-turtle support

This commit is contained in:
2025-10-13 09:42:34 +02:00
parent 1366f5e77f
commit bbb9348497
11 changed files with 408 additions and 198 deletions
+1 -1
View File
@@ -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));
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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();