Fix turtle angles, states, and colors.

This commit is contained in:
Scott Richmond 2023-12-08 17:20:57 -05:00
parent 0e42d893e8
commit b61322bbfd
2 changed files with 4 additions and 2 deletions

View File

@ -5,6 +5,8 @@
if turtle_state() :visible? then render_turtle! () else nil if turtle_state() :visible? then render_turtle! () else nil
make! (turtle_states, [turtle_init])
let console_msgs = flush! () let console_msgs = flush! ()
let (r, g, b, a) = deref (bgcolor) let (r, g, b, a) = deref (bgcolor)

View File

@ -882,7 +882,7 @@ let turtle_radius = 20
let turtle_angle = 0.375 let turtle_angle = 0.375
let turtle_color = (100, 100, 100, 100) let turtle_color = (150, 150, 150, 200)
fn render_turtle! () -> { fn render_turtle! () -> {
let state = do turtle_states > deref > last let state = do turtle_states > deref > last
@ -894,7 +894,7 @@ fn render_turtle! () -> {
add_call! ((:noStroke)) add_call! ((:noStroke))
let #{heading, :position (x, y)} = state let #{heading, :position (x, y)} = state
add_call! ((:translate, x, y)) add_call! ((:translate, x, y))
add_call! ((:rotate, turn/deg (heading))) add_call! ((:rotate, turn/rad (heading)))
add_call! ((:beginShape)) add_call! ((:beginShape))
let head_unit = heading/vector (heading) let head_unit = heading/vector (heading)
let first = mult (head_unit, turtle_radius) let first = mult (head_unit, turtle_radius)