Compare commits
No commits in common. "d0a5128e0eb66f83041ec0e318bc1b56bad6e817" and "2686d70a4914f5d887a74dbc896042b28cc1a7c9" have entirely different histories.
d0a5128e0e
...
2686d70a49
Binary file not shown.
|
@ -191,11 +191,8 @@ const turtle_angle = 0.385
|
|||
const turtle_color = [255, 255, 255, 150]
|
||||
|
||||
const p5_call_root = [
|
||||
["push"],
|
||||
["rotate", Math.PI],
|
||||
["scale", -1, 1],
|
||||
["background", ...resolve_color(background_color)],
|
||||
["stroke", ...resolve_color(turtle_init.pencolor)],
|
||||
["stroke", ...resolve_color(turtle_init.pencolor)]
|
||||
]
|
||||
|
||||
function rotate (vector, heading) {
|
||||
|
@ -327,8 +324,7 @@ function p5_render_turtle (state, calls) {
|
|||
const [x2, y2] = rotate(origin, turtle_angle)
|
||||
const [x3, y3] = rotate(origin, -turtle_angle)
|
||||
calls.push(["translate", x, y])
|
||||
// need negative turtle rotation with the other p5 translations
|
||||
calls.push(["rotate", -turn_to_rad(heading)])
|
||||
calls.push(["rotate", turn_to_rad(heading)])
|
||||
calls.push(["noStroke"])
|
||||
calls.push(["beginShape"])
|
||||
calls.push(["vertex", x1, y1])
|
||||
|
@ -357,7 +353,6 @@ export function p5 (commands) {
|
|||
for (const call of calls) {
|
||||
p5_calls.push(call)
|
||||
}
|
||||
p5_calls.push("pop")
|
||||
}
|
||||
p5_calls[0] = ["background", ...resolve_color(background_color)]
|
||||
p5_render_turtle(states[states.length - 1], p5_calls)
|
||||
|
|
BIN
build/out.wasm
BIN
build/out.wasm
Binary file not shown.
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@ludus/ludus-js-pure",
|
||||
"version": "0.1.28",
|
||||
"version": "0.1.27",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@ludus/ludus-js-pure",
|
||||
"version": "0.1.28",
|
||||
"version": "0.1.27",
|
||||
"license": "GPL-3.0",
|
||||
"devDependencies": {
|
||||
"shadow-cljs": "^2.26.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@ludus/ludus-js-pure",
|
||||
"version": "0.1.28",
|
||||
"version": "0.1.27",
|
||||
"description": "A Ludus interpreter in a pure JS function.",
|
||||
"type": "module",
|
||||
"main": "build/ludus.mjs",
|
||||
|
|
Loading…
Reference in New Issue
Block a user