{"id":0,"registry":{"0":{"submorphs":[{"__isSmartRef__":true,"id":1}],"scripts":[],"id":"C0BD682D-2425-4D25-B5C7-E135ABE0E204","shape":{"__isSmartRef__":true,"id":14},"droppingEnabled":true,"halosEnabled":true,"showsHalos":false,"__serializedExpressions__":["_Position","distanceToDragEvent"],"name":"AngryEye","partsBinMetaInfo":{"__isSmartRef__":true,"id":15},"eventHandler":{"__isSmartRef__":true,"id":18},"layout":{"__isSmartRef__":true,"id":19},"derivationIds":[5320,"905575EB-2574-43FF-89BD-BFD559103BF8","03895927-2D72-4C93-8A2F-28FE328FA00A"],"_ClipMode":"visible","moved":true,"_Rotation":0,"_Scale":1,"__LivelyClassName__":"lively.morphic.Morph","__SourceModuleName__":"Global.lively.morphic.Core","_Position":"lively.pt(0.0,0.0)","distanceToDragEvent":"lively.pt(53.0,-11.6)"},"1":{"submorphs":[],"scripts":[{"__isSmartRef__":true,"id":2}],"id":"98AF7B05-3108-4368-B7D1-3F6E1D566A71","shape":{"__isSmartRef__":true,"id":3},"droppingEnabled":true,"halosEnabled":true,"showsHalos":false,"__serializedExpressions__":["_Position"],"name":"Ellipse","partsBinMetaInfo":{"__isSmartRef__":true,"id":4},"owner":{"__isSmartRef__":true,"id":0},"eventHandler":{"__isSmartRef__":true,"id":5},"layout":{"__isSmartRef__":true,"id":6},"derivationIds":[5321,"565177FB-804A-442F-BE22-9F88E76CCAAB","43B05294-8820-4E51-9C99-1E5C94FDBC1A"],"_ClipMode":"visible","isBeingDragged":false,"prevScroll":[0,0],"c":18,"_Rotation":0,"_Scale":1,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":7},"__LivelyClassName__":"lively.morphic.Morph","__SourceModuleName__":"Global.lively.morphic.Core","_Position":"lively.pt(10.9,8.3)"},"2":{"suspended":false,"target":{"__isSmartRef__":true,"id":1},"selector":"pupilFollowMouse","args":[],"stopped":false,"tickTime":100,"__LivelyClassName__":"lively.morphic.TargetScript","__SourceModuleName__":"Global.lively.morphic.Core"},"3":{"__serializedExpressions__":["position","_Extent","_Fill","_BorderColor","_Padding"],"_BorderWidth":0,"_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","__LivelyClassName__":"lively.morphic.Shapes.Ellipse","__SourceModuleName__":"Global.lively.morphic.Shapes","position":"lively.pt(0.0,0.0)","_Extent":"lively.pt(11.2,11.2)","_Fill":"Color.rgb(204,0,0)","_BorderColor":"Color.rgb(255,255,255)","_Padding":"lively.rect(0,0,0,0)"},"4":{"partsSpaceName":"PartsBin/NewWorld","migrationLevel":1,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo","__SourceModuleName__":"Global.lively.PartsBin"},"5":{"morph":{"__isSmartRef__":true,"id":1},"__LivelyClassName__":"lively.morphic.EventHandler","__SourceModuleName__":"Global.lively.morphic.Events"},"6":{},"7":{"pupilFollowMouse":{"__isSmartRef__":true,"id":8},"fire":{"__isSmartRef__":true,"id":11}},"8":{"varMapping":{"__isSmartRef__":true,"id":9},"source":"function pupilFollowMouse() { \n    this.c = this.c||0;this.c++;if(this.c>=20){\n        this.c=0;\n        this.fire();\n    }\n    var eye = this.owner;\n    var eyeR = Math.min(eye.bounds().width, eye.bounds().height)/2;\n    var pupilR = Math.min(this.bounds().width, this.bounds().height)/2;\n    var mousePt = this.world().firstHand().getPosition();\n    var eyePt = eye.worldPoint(eye.innerBounds().center());\n    var relMousePt = mousePt.subPt(eyePt);\n    var pupilR = (eyeR-pupilR) / (1 + (200/Math.max(mousePt.r(), 1)));\n    var pupilPt = Point.polar([pupilR, mousePt.dist(eyePt)].min(), relMousePt.theta());\n    this.align(this.bounds().center(),\n    eye.innerBounds().center().addPt(pupilPt));\n}","funcProperties":{"__isSmartRef__":true,"id":10},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"9":{"this":{"__isSmartRef__":true,"id":1}},"10":{"__serializedExpressions__":["timestamp"],"user":"ohshima","tags":[],"timestamp":"new Date(\"Wed Jul 17 2013 15:09:59 GMT-0700 (PDT)\")"},"11":{"varMapping":{"__isSmartRef__":true,"id":12},"source":"function fire() {\n    //console.log(\"firing\");\n    //return;\n    var b = new lively.morphic.Box(rect(0,0,10,10));\n    b.setPosition(this.getPositionInWorld());\n    b.setExtent(pt(10,10));\n    b.setFill(Color.black);\n    $world.addMorphBack(b);\n\n    var v = this.world().firstHand().getPosition().subPt(this.getPositionInWorld()).normalized().scaleBy(50);\n    b.moveBy(v);\n    var i = window.setInterval(function(){b.moveBy(v);},100)\n    window.setTimeout(function() {\n        window.clearInterval(i);\n        b.remove();\n    }, 5000)\n}","funcProperties":{"__isSmartRef__":true,"id":13},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"12":{"this":{"__isSmartRef__":true,"id":1}},"13":{"__serializedExpressions__":["timestamp"],"user":"sstamm","tags":[],"timestamp":"new Date(\"Wed May 02 2012 06:19:50 GMT-0700 (PDT)\")"},"14":{"__serializedExpressions__":["position","_Extent","_Fill","_Padding"],"_BorderWidth":0,"_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","__LivelyClassName__":"lively.morphic.Shapes.Ellipse","__SourceModuleName__":"Global.lively.morphic.Shapes","position":"lively.pt(0.0,0.0)","_Extent":"lively.pt(26.0,22.0)","_Fill":"Color.rgb(255,255,255)","_Padding":"lively.rect(0,0,0,0)"},"15":{"partsSpaceName":"PartsBin/Fun/","migrationLevel":8,"partName":"AngryEye","comment":"no comment","changes":[{"__isSmartRef__":true,"id":16},{"__isSmartRef__":true,"id":17}],"__serializedExpressions__":["lastModifiedDate"],"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo","__SourceModuleName__":"Global.lively.PartsBin","lastModifiedDate":"new Date(\"Wed Sep 05 2012 16:01:35 GMT-0700 (PDT)\")"},"16":{"__serializedExpressions__":["date"],"author":"sstamm","message":"no comment","id":"319F4BD4-F580-42C1-A25B-B341CD62BB4C","date":"new Date(\"Wed May 02 2012 03:48:23 GMT-0700 (PDT)\")"},"17":{"__serializedExpressions__":["date"],"author":"ohshima","message":"no comment","id":"B4D30B59-A122-47C1-BABC-81AC9C998C0B","date":"new Date(\"Wed Jul 17 2013 15:10:19 GMT-0700 (PDT)\")"},"18":{"morph":{"__isSmartRef__":true,"id":0},"__LivelyClassName__":"lively.morphic.EventHandler","__SourceModuleName__":"Global.lively.morphic.Events"},"19":{},"isSimplifiedRegistry":true}}