david-pfx / PuzzleScriptNext

A direct successor to PuzzleScript, building on the work of PuzzleScript Plus, Pattern:Script and others.
http://www.puzzlescriptnext.polyomino.com
MIT License
12 stars 5 forks source link

Object definition with tag and `canvas:` generates bad sprites instead of JSON #63

Closed david-pfx closed 2 months ago

david-pfx commented 3 months ago

@clickmazes https://gist.github.com/angilbert/3c6b8078c4b48b814fcaa05f09368364

eyes:directions canvas:
{"beginPath":[]} {"arc":[0.2, 0.2,  0.2,0,7]} {"fillStyle":"white"} {"fill":[]}
{"beginPath":[]} {"arc":[0.25,0.15, 0.1,0,7]} {"fillStyle":"black"} {"fill":[]}
{"beginPath":[]} {"arc":[0.8, 0.2,  0.2,0,7]} {"fillStyle":"white"} {"fill":[]}
{"beginPath":[]} {"arc":[0.75,0.15, 0.1,0,7]} {"fillStyle":"black"} {"fill":[]}
rot:up:>

The object definition eyes:directions generates 4 objects, but it doesn't copy the JSON so you get square magenta sprites instead. The clue is in the error message.

angilbert commented 3 months ago

Here is another simple test GIST that exhibits the same problem (here using both "translate:" and "rot:" )... https://gist.github.com/angilbert/1190d678d00e5142b34e4bce325eb1e8