forked from sugarlabs/musicblocks
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathturtle.json
executable file
·13 lines (13 loc) · 2.51 KB
/
turtle.json
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"BLOCKPLUGINS": {
"xturtle": "var getxTurtleBlock = new ProtoBlock('xturtle');getxTurtleBlock.palette = palettes.dict['extras'];blocks.protoBlockDict['xturtle'] = getxTurtleBlock;getxTurtleBlock.staticLabels.push(_('turtle x'));getxTurtleBlock.adjustWidthToLabel();getxTurtleBlock.oneArgBlock();getxTurtleBlock.dockTypes[1] = 'anyin';getxTurtleBlock.defaults.push('0');",
"yturtle": "var getyTurtleBlock = new ProtoBlock('yturtle');getyTurtleBlock.palette = palettes.dict['extras'];blocks.protoBlockDict['yturtle'] = getyTurtleBlock;getyTurtleBlock.staticLabels.push(_('turtle y'));getyTurtleBlock.adjustWidthToLabel();getyTurtleBlock.oneArgBlock();getyTurtleBlock.dockTypes[1] = 'anyin';getyTurtleBlock.defaults.push('0');",
"stopTurtle": "var stopTurtleBlock = new ProtoBlock('stopTurtle');stopTurtleBlock.palette = palettes.dict['extras'];blocks.protoBlockDict['stopTurtle'] = stopTurtleBlock;stopTurtleBlock.staticLabels.push(_('stop turtle'));stopTurtleBlock.adjustWidthToLabel();stopTurtleBlock.oneArgBlock();stopTurtleBlock.dockTypes[1] = 'anyin';stopTurtleBlock.defaults.push('0');",
"setturtlename": "var setTurtleName = new ProtoBlock('setturtlename');setTurtleName.palette = palettes.dict['extras'];blocks.protoBlockDict['setturtlename'] = setTurtleName;setTurtleName.staticLabels.push(_('turtle name'));setTurtleName.staticLabels.push(_('source'));setTurtleName.staticLabels.push(_('target'));setTurtleName.adjustWidthToLabel();setTurtleName.twoArgBlock();setTurtleName.dockTypes[1] = 'anyin';setTurtleName.dockTypes[2] = 'anyin';setTurtleName.defaults.push('0');setTurtleName.defaults.push('Yertle');",
"startTurtle": "var startTurtleBlock = new ProtoBlock('startTurtle');startTurtleBlock.palette = palettes.dict['extras'];blocks.protoBlockDict['startTurtle'] = startTurtleBlock;startTurtleBlock.staticLabels.push(_('start turtle'));startTurtleBlock.adjustWidthToLabel();startTurtleBlock.oneArgBlock();startTurtleBlock.dockTypes[1] = 'anyin';startTurtleBlock.defaults.push('0');"
},
"GLOBALS": "",
"FLOWPLUGINS": {
"setturtlename": "var cblk = logo.blocks.blockList[blk].connections[1];var sourceName = args[0];var targetName = args[1];var thisTurtle = null;var foundTurtle = false;for (var i = 0; i < turtles.turtleList.length; i++) { thisTurtle = turtles.turtleList[i]; if (sourceName == thisTurtle.name) { thisTurtle.name = targetName; foundTurtle = true; break; }}if (!foundTurtle) { logo.errorMsg('Could not find turtle ' + sourceName, blk);}"
}
}