Skip to content

Commit 11b811f

Browse files
author
Antonino Tramontana
committed
fixed block function
1 parent c5073f7 commit 11b811f

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/components/Activity.vue

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,40 +1666,46 @@ export default {
16661666
};
16671667
16681668
1669-
Blockly.Blocks['coderbot_music_note_sol'] = {
1669+
Blockly.Blocks['coderbot_music_note_basic'] = {
16701670
init: function() {
16711671
this.appendDummyInput()
1672-
.appendField(new Blockly.FieldImage("https://www.gstatic.com/codesite/ph/images/s tar_on.gif", 30, 30, "25"));
1673-
this.appendDummyInput()
1674-
.setAlign(Blockly.ALIGN_CENTRE)
1675-
.appendField("SOL");
1672+
.appendField(new Blockly.FieldImage("https://svgsilh.com/svg/1314943.svg", 30, 30, "25"));
1673+
.appendField(" DO ");
16761674
this.setPreviousStatement(true, null);
16771675
this.setNextStatement(true, null);
1678-
this.setColour(230);
1679-
this.setTooltip("nota SOL");
1676+
this.setColour(345);
1677+
this.setTooltip("nota DO");
16801678
this.setHelpUrl("");
16811679
}
16821680
};
16831681
1682+
//.setAlign(Blockly.ALIGN_CENTRE)
16841683
1685-
Blockly.Python['coderbot_music_note_sol'] = {
1684+
Blockly.Python['coderbot_music_note_sol'] = function(block) {
16861685
// TODO: Assemble Python into code variable.
1687-
var code = 'get_music().play_note("A2")\n';
1686+
var code = 'get_music().play_note(A2)\n';
16881687
return code;
16891688
16901689
};
16911690
1692-
Blockly.Blocks['coderbot_animal_verse'] = {
1691+
Blockly.Blocks['coderbot_animal_verse_basic'] = {
16931692
init: function() {
16941693
this.appendDummyInput()
16951694
.appendField(new Blockly.FieldImage("https://upload.wikimedia.org/wikipedia/commons/7/71/Paw_%28Animal_Rights_symbol%29.svg", 15, 15, { alt: "*", flipRtl: "FALSE" }))
16961695
.appendField("Verso del")
16971696
.appendField(new Blockly.FieldDropdown([["Gatto","cat"], ["Cane","dog"]]), "Verso del");
1698-
this.setColour(345);
1697+
this.setColour(290);
16991698
this.setTooltip("Verso animale");
17001699
this.setHelpUrl("");
17011700
}
17021701
};
1702+
1703+
Blockly.Python['coderbot_animal_verse_basic'] = function(block) {
1704+
var dropdown_verso_del = block.getFieldValue('Verso del');
1705+
// TODO: Assemble Python into code variable.
1706+
var code = '...\n';
1707+
return code;
1708+
};
17031709
17041710
Blockly.Python['coderbot_audio_listen'] = function(block) {
17051711
// Boolean values true and false.

0 commit comments

Comments
 (0)