bring in and update postlude
This commit is contained in:
parent
176feb5ae2
commit
d84a930073
|
@ -57,4 +57,9 @@ This new scene will have to return a JSON POJSO:
|
|||
(-> source run)
|
||||
)
|
||||
|
||||
(comment
|
||||
Next up:
|
||||
* postlude!
|
||||
* testing turtle graphics
|
||||
)
|
||||
|
||||
|
|
25
janet/postlude.ld
Normal file
25
janet/postlude.ld
Normal file
|
@ -0,0 +1,25 @@
|
|||
& this file runs after any given interpretation
|
||||
& even if the original interpretation panics
|
||||
& the goal is to output any global state held in Ludus
|
||||
& this does not have base loaded into it, only prelude: must be pure Ludus
|
||||
|
||||
if turtle_state () :visible? then render_turtle! () else nil
|
||||
|
||||
reset_turtle! ()
|
||||
|
||||
let console_msgs = flush! ()
|
||||
|
||||
let (r, g, b, a) = unbox (bgcolor)
|
||||
make! (bgcolor, colors :black)
|
||||
|
||||
let draw_calls = unbox (p5_calls)
|
||||
store! (p5_calls, [])
|
||||
|
||||
#{
|
||||
& :result result is provided elsewhere
|
||||
& :errors [] & if we get here there are no errors
|
||||
:console console_msgs
|
||||
:draw concat (
|
||||
[(:background, r, g, b, a), (:stroke, 255, 255, 255, 255)]
|
||||
draw_calls)
|
||||
}
|
Loading…
Reference in New Issue
Block a user