commit
c5ea1c23d8
@ -18,17 +18,17 @@ editor_blockly = function () {
|
|||||||
{"type": "hide", "time": 500},
|
{"type": "hide", "time": 500},
|
||||||
],'event'),
|
],'event'),
|
||||||
MotaActionBlocks['changeFloor_m'].xmlText(),
|
MotaActionBlocks['changeFloor_m'].xmlText(),
|
||||||
MotaActionFunctions.actionParser.parse({"type": "choices", "choices": [
|
//MotaActionFunctions.actionParser.parse({"type": "choices", "choices": [
|
||||||
{"text": "攻击+\${point}", "action": [
|
// {"text": "攻击+\${point}", "action": [
|
||||||
{"type": "setValue", "name": "status:atk", "value": "status:atk+\${point}"},
|
// {"type": "setValue", "name": "status:atk", "value": "status:atk+\${point}"},
|
||||||
]},
|
// ]},
|
||||||
{"text": "防御+\${2*point}", "action": [
|
// {"text": "防御+\${2*point}", "action": [
|
||||||
{"type": "setValue", "name": "status:def", "value": "status:def+\${2*point}"},
|
// {"type": "setValue", "name": "status:def", "value": "status:def+\${2*point}"},
|
||||||
]},
|
// ]},
|
||||||
{"text": "生命+\${200*point}", "action": [
|
// {"text": "生命+\${200*point}", "action": [
|
||||||
{"type": "setValue", "name": "status:hp", "value": "status:hp+\${200*point}"},
|
// {"type": "setValue", "name": "status:hp", "value": "status:hp+\${200*point}"},
|
||||||
]},
|
// ]},
|
||||||
]},'point'),
|
//]},'point'),
|
||||||
MotaActionFunctions.actionParser.parse([{
|
MotaActionFunctions.actionParser.parse([{
|
||||||
"id": "moneyShop1",
|
"id": "moneyShop1",
|
||||||
"name": "贪婪之神",
|
"name": "贪婪之神",
|
||||||
@ -269,6 +269,18 @@ document.getElementById('blocklyDiv').onmousewheel = function(e){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(editor_blockly.workspace.topBlocks_.length>=2){
|
||||||
|
codeAreaHL.setValue('入口方块只能有一个');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var eventType = document.getElementById('entryType').value;
|
||||||
|
if(editor_blockly.workspace.topBlocks_.length==1){
|
||||||
|
var blockType = editor_blockly.workspace.topBlocks_[0].type;
|
||||||
|
if(blockType!==eventType+'_m'){
|
||||||
|
codeAreaHL.setValue('入口方块类型错误');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
var code = Blockly.JavaScript.workspaceToCode(workspace);
|
var code = Blockly.JavaScript.workspaceToCode(workspace);
|
||||||
codeAreaHL.setValue(code);
|
codeAreaHL.setValue(code);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user