@@ -1668,30 +1668,33 @@ export default {
1668
1668
1669
1669
Blockly .Blocks [' coderbot_music_note_basic' ] = {
1670
1670
init : function () {
1671
- this .appendDummyInput ()
1672
- .appendField (new Blockly.FieldImage (" https://svgsilh.com/svg/1314943.svg" , 30 , 30 , " 25" ));
1673
- .appendField (" DO " );
1674
- this .setPreviousStatement (true , null );
1675
- this .setNextStatement (true , null );
1676
- this .setColour (345 );
1677
- this .setTooltip (" nota DO" );
1678
- this .setHelpUrl (" " );
1671
+ this .appendDummyInput ()
1672
+ .setAlign (Blockly .ALIGN_CENTRE )
1673
+ .appendField (new Blockly.FieldImage (" /static/images/blocks/musical_note.png" , 30 , 30 , { alt: " note" , flipRtl: " FALSE" }))
1674
+ .appendField (" NOTA " )
1675
+ .appendField (new Blockly.FieldDropdown ([[" DO " ," C2" ], [" RE " ," D2" ], [" MI " ," E2" ], [" FA " ," F2" ], [" SOL " ," G2" ], [" LA " ," A3" ], [" SI " ," B3" ], [" DO+ " ," C3" ], [" RE+ " ," D3" ], [" PAUSA" ," PAUSE" ]]), " NAME" );
1676
+ this .setInputsInlin (true );
1677
+ this .setPreviousStatement (true , null );
1678
+ this .setNextStatement (true , null );
1679
+ this .setColour (345 );
1680
+ this .setTooltip (" " );
1681
+ this .setHelpUrl (" " );
1679
1682
}
1680
1683
};
1681
1684
1682
- // .setAlign(Blockly.ALIGN_CENTRE)
1683
-
1684
- Blockly . Python [ ' coderbot_music_note_sol ' ] = function ( block ) {
1685
+
1686
+ Blockly . Python [ ' coderbot_music_note_basic ' ] = function ( block ) {
1687
+ var dropdown_name = block . getFieldValue ( ' NAME ' );
1685
1688
// TODO: Assemble Python into code variable.
1686
- var code = ' get_music().play_note(A2 )\n ' ;
1689
+ var code = ' get_music().play_note()\n ' ;
1687
1690
return code;
1688
-
1689
1691
};
1690
1692
1693
+
1691
1694
Blockly .Blocks [' coderbot_animal_verse_basic' ] = {
1692
1695
init : function () {
1693
1696
this .appendDummyInput ()
1694
- .appendField (new Blockly.FieldImage (" https://upload.wikimedia.org/wikipedia/commons/7/71/Paw_%28Animal_Rights_symbol%29.svg " , 15 , 15 , { alt: " *" , flipRtl: " FALSE" }))
1697
+ .appendField (new Blockly.FieldImage (" /static/images/blocks/animal.png " , 15 , 15 , { alt: " *" , flipRtl: " FALSE" }))
1695
1698
.appendField (" Verso del" )
1696
1699
.appendField (new Blockly.FieldDropdown ([[" Gatto" ," cat" ], [" Cane" ," dog" ]]), " Verso del" );
1697
1700
this .setColour (290 );
@@ -1701,9 +1704,9 @@ export default {
1701
1704
};
1702
1705
1703
1706
Blockly .Python [' coderbot_animal_verse_basic' ] = function (block ) {
1704
- var dropdown_verso_del = block .getFieldValue (' Verso del' );
1707
+ var dropdown_animal = block .getFieldValue (' Verso del' );
1705
1708
// TODO: Assemble Python into code variable.
1706
- var code = ' ... \n ' ;
1709
+ var code = ' get_music().play_animal(dropdown_animal) \n ' ;
1707
1710
return code;
1708
1711
};
1709
1712
0 commit comments