enable basic left and right rotation

This commit is contained in:
Dietrich 2022-12-07 13:51:46 +01:00
parent 009f896e08
commit 11b9539800

View File

@ -5,7 +5,7 @@ use crate::{
drawing::{ drawing::{
self, self,
animation::{ animation::{
draw_straight_segment, move_straight_segment, ToAnimationSegment, draw_straight_segment, move_straight_segment, turtle_turn, ToAnimationSegment,
TurtleAnimationSegment, TurtleAnimationSegment,
}, },
TurtleGraphElement, TurtleGraphElement,
@ -89,7 +89,12 @@ impl ToAnimationSegment for DrawElement {
MoveCommand::Circle { radius, angle } => todo!(), MoveCommand::Circle { radius, angle } => todo!(),
MoveCommand::Goto(coord) => todo!(), MoveCommand::Goto(coord) => todo!(),
}, },
DrawElement::Orient(_) => todo!(), DrawElement::Orient(e) => match e {
OrientationCommand::Left(angle_to_turn) => turtle_turn(state, -*angle_to_turn),
OrientationCommand::Right(angle_to_turn) => turtle_turn(state, *angle_to_turn),
OrientationCommand::SetHeading => todo!(),
OrientationCommand::LookAt(_) => todo!(),
},
DrawElement::Drip(_) => todo!(), DrawElement::Drip(_) => todo!(),
} }
} }