-
Notifications
You must be signed in to change notification settings - Fork 7
/
clone-handle.xml
1 lines (1 loc) · 12.1 KB
/
clone-handle.xml
1
<project name="clone-handle" app="Snap! 4.0, http://snap.berkeley.edu" version="1"><notes>This project is a test of having one sprite get the position of another sprite using the output of the "my self" block.

When you press the green the flag it creates 10 clones of the red sprite. Each clone created gets a darker shade of blue and the master sprite stays red so you can tell them apart. Each clone adds itself to the list and constantly "says" its own x position. When you press the space bar, the black sprite will say the position of the first clone in the list. You can verify that it gets the right value by moving the clones around. It also works to pass the variable to the "distance to" block. 

But I don't see a way to use the variable to call a method of the sprite or to get the alue of a member variable. </notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAAKV0lEQVR4Xu2dC0wVVxrH/4BWUEFBUKNgi4RqVXC1m2qNT6C4pVaXKijUIrXrmu0mbLYuwZi4WqyP9UF1je5WY4v1sVqQan3RUh/R+KpvsD4RFp+7xFUWH1yKwOaMuaeMVzaXe5Ezl/lPYghm5nzf9zu/fHPPzDDXrba2thbcSEARATcKqIg8w2oEKCBFUEqAAirFz+AUkA4oJSAFrKysxOXLl+Ht7Q13d3eItYmbm1uT/ayursaFCxcQExOjFAiDNy0BKWBBQYEmX13pfH19ce/evSaTUEjv5+cHHx+fpqXAaMoISAGLi4tlEv7+/nj06BHE//Xr1w8WiwWenp7Iz8/HtWvXILql+Dl+/PhGT/zgwYNISkpq9HE5oDEJSAGLiopkhuHh4SgrK4M4LQoZy8vL8fjxY+1n9+7dISQZNGiQJmRjb1u2bEFqampjD8vxDEpAClhYWGiIFIWAaWlphsiFSTx/AlLAK1euyGhXs/+CsuNb4fb84yP0lTB4J6+SkYSA06dPb4LIDGEEAlLAS5cuyQVIxeJhCOrgjdKkbWjdps1zWQ2X/es6uuYko1VtJW598L1c6GRnZ2PGjBlGYMMcmoCATkDrpZcWfx2Byg/z4NW6tU6+oMBArB/cDqE+LRuUmpsb8Or2Uty8eRO3bt3C/fv3IVbY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Pzx5D7969GyOMkjEooBLsDQtan4BbPCzIoIANg8m9G0ZgXHh/RBc8+X69Ih9P9Fz2CZKTkxs2iIH3Zgc08OScOHEC65ctx9J1aw2cpXOpUUDn+PFoJwlQQCcB8nDnCFBA5/jxaCcJGFbA4uJiBAcHO1keDzc6AcMKKMDFxsZq/CoqKrRvW+fW/AgYWsDS0lJMnTrVhnpYWBjS09Ob32yYsCJDCyjmQ3xFRFVV1TOnprCwUHutLzfXJWBoAXv16oUePXpIuuIVwqmpqRg9erTrEmfmOgKGFXDx4sUQX6DYs2dP+d1ynLvmR8CwAjY/1KzoWQQoIL1QSoACKsXP4BSQDiglQAGV4mdwCkgHlBKggErxMzgFpANKCVBApfgZnALSAaUEKKBS/AxOAemAUgIUUCl+BqeAdEApAQqoFD+DU0A6oJQABVSKn8EpIB1QSoACKsXP4BSQDiglQAGV4mdwCkgHlBKggErxMzgFpANKCVBApfgZnALSAaUEKKBS/AxOAemAUgIUUCl+BqeAdEApAQqoFD+DU0A6oJQABVSKn8EpIB1QSoACKsXP4BSQDiglQAGV4mdwCkgHlBKggErxMzgFpANKCVBApfgZnALSAaUEKKBS/AxOAemAUgIUUCl+BqeAdEApAQqoFD+DU0A6oJTA/wCBXajzMqNCrwAAAABJRU5ErkJggg==</thumbnail><stage name="Stage" width="480" height="360" costume="0" tempo="60" threadsafe="false" lines="round" codify="false" inheritance="false" sublistIDs="false" scheduled="false" id="1"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAOhUlEQVR4Xu3VwQkAAAjEMN1/abewn7jAQRC64wgQIECAAIF3gX1fNEiAAAECBAiMAHsCAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECg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IBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQIHLFxAWmhEwHPAAAAAElFTkSuQmCC</pentrails><costumes><list id="2"></list></costumes><sounds><list id="3"></list></sounds><variables></variables><blocks></blocks><scripts></scripts><sprites><sprite name="Reporter" idx="1" x="-96" y="-28" heading="90" scale="1" rotation="1" draggable="true" costume="0" color="80,80,80" pen="tip" id="8"><costumes><list id="9"></list></costumes><sounds><list id="10"></list></sounds><variables></variables><blocks></blocks><scripts><script x="29" y="61"><block s="receiveKey"><l><option>space</option></l></block><block s="doSayFor"><block s="reportAttributeOf"><l><option>x position</option></l><block s="reportListItem"><l>1</l><block var="clones"/></block></block><l>2</l></block></script><script x="29" y="157"><block s="doSayFor"><block s="reportDistanceTo"><block s="reportListItem"><l>1</l><block var="clones"/></block></block><l>2</l></block></script></scripts></sprite><sprite name="Cloned" idx="2" x="100" y="0" heading="90" scale="1" rotation="1" draggable="true" costume="0" color="153,0,19" pen="tip" id="33"><costumes><list id="34"></list></costumes><sounds><list id="35"></list></sounds><variables></variables><blocks></blocks><scripts><script x="20" y="10"><block s="receiveOnClone"></block><block s="doAddToList"><block s="reportGet"><l><option>self</option></l></block><block var="clones"/></block><block s="doForever"><script><block s="bubble"><block s="xPosition"></block></block></script></block></script><script x="17" y="164"><block s="receiveGo"></block><block s="doIf"><block s="reportTrue"></block><script><block s="removeClone"></block></script></block><block s="gotoXY"><l>0</l><l>0</l></block><block s="setHeading"><l>90</l></block><block s="setColor"><color>158,232,255,1</color></block><block s="doSetVar"><l>clones</l><block s="reportNewList"><list></list></block></block><block s="doRepeat"><l>10</l><script><block s="createClone"><l><option>myself</option></l></block><block s="forward"><l>10</l></block><block s="changeBrightness"><l>10</l></block></script></block><block s="setColor"><color>153,0,19,1</color></block></script><script x="242" y="40.999999999999886"><block s="doInsertInList"><block s="reportGet"><l><option>self</option></l></block><l><option>last</option></l><block var="clones"/></block></script></scripts></sprite><watcher var="clones" style="normal" x="5" y="14" color="243,118,29" extX="80" extY="70"/></sprites></stage><hidden></hidden><headers></headers><code></code><blocks></blocks><variables><variable name="clones"><list id="92"><item></item><item></item><item></item><item></item><item></item><item></item><item></item><item></item><item></item><item></item></list></variable></variables></project>