diff --git a/protocols/schemas/shapes.prs b/protocols/schemas/shapes.prs index 9295e94..db34423 100644 --- a/protocols/schemas/shapes.prs +++ b/protocols/schemas/shapes.prs @@ -5,7 +5,7 @@ Variable = . Shape = Mesh / Light / Scale / Move / Rotate / @many [Shape ...] / Texture / Color / Sound / Name / Floor / Nonphysical / Touchable / CSG / Skybox . -Mesh = Sphere / Box / Ground / Plane / External . +Mesh = Sphere / Box / Ground / Plane / External / @turtle turtle.Shape . Sphere = . Box = . diff --git a/protocols/schemas/turtle.prs b/protocols/schemas/turtle.prs new file mode 100644 index 0000000..9959ed1 --- /dev/null +++ b/protocols/schemas/turtle.prs @@ -0,0 +1,7 @@ +version 1 . + +Program = Block . +Block = [Token ...] . +Token = @i int / @d double / @b bool / @s string / @v symbol / @block Block . + +Shape = . diff --git a/scene/lobby.pr b/scene/lobby.pr index e2bace7..5b4b0f1 100644 --- a/scene/lobby.pr +++ b/scene/lobby.pr @@ -92,18 +92,58 @@ ; ; >>> - - - ] - - >>> - >>> - ]> - >>>>> +; +; +; ] +; +; >>> +; >>> +; ]> +; >>>>> + +; +; >> + + + >> ; ; >>(); @@ -260,6 +261,12 @@ export function buildMesh( }), }; } + case "turtle": { + const t = new TurtleVM(name, scene, meshSpec.value.program.map(fromJS)); + t.debug = true; + t.exec(); + return { rootnode: t.container }; + } } }