diff options
| author | Code WvS <code-wvs@quantentunnel.de> | 2015-03-01 17:48:36 +0100 |
|---|---|---|
| committer | Code WvS <code-wvs@quantentunnel.de> | 2015-03-01 17:48:36 +0100 |
| commit | 2a6993efae6e961660ecd2aa1f999f10aadf94f4 (patch) | |
| tree | 0e17ff542086f2d83c00a1bb63bdb577ece4bd97 /snap.html | |
| parent | 5b615ebf5cfc4f6aa6c5930dcc7ec7e211e883df (diff) | |
| download | snap-yow-2a6993efae6e961660ecd2aa1f999f10aadf94f4.tar.gz snap-yow-2a6993efae6e961660ecd2aa1f999f10aadf94f4.zip | |
draw pen trails; expand to polygons automatically
Diffstat (limited to 'snap.html')
| -rwxr-xr-x | snap.html | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -57,7 +57,7 @@ }; // Snap! YOW starts here - var world, map, layer, spriteGroup; + var world, map, layer, spriteGroup, polylines, polylineIndex; function loop() { world.doOneCycle(); @@ -115,6 +115,15 @@ window.spriteGroup = spriteGroup; spriteGroup = L.layerGroup().addTo(map); + // During a pen down, a polyline is updated at polylines[this.myPolylineIndex]. + // On pen up, myPolylineIndex is set to polylineIndex and polylineIndex is incremented + // so polylines contains complete lines created by different sprites. + // These lines might be (partially) transformed into polygons. + window.penTrails = L.layerGroup().addTo(map); + window.polylines = polylines; + polylineIndex = 0; + polylines = []; + // Load the IDE world = new WorldMorph(document.getElementById('world')); world.worldCanvas.focus(); |
