robot.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. 'use strict';
  2. goog.provide('Blockly.Blocks.robot');
  3. goog.require('Blockly.Blocks');
  4. /* Blockly.Blocks['robot_biped_init'] = {
  5. init: function() {
  6. this.appendDummyInput()
  7. .appendField(Blockly.Msg.MOTOR_BIPED_SETUP);
  8. this.appendDummyInput()
  9. .appendField(Blockly.Msg.LED_SET_WORD + " PIN_RR " + Blockly.Msg.MOTOR_AS)
  10. .appendField(new Blockly.FieldTextInput("11"), "pin_rr");
  11. this.appendDummyInput()
  12. .appendField(Blockly.Msg.LED_SET_WORD + " PIN_RL " + Blockly.Msg.MOTOR_AS)
  13. .appendField(new Blockly.FieldTextInput("10"), "pin_rl");
  14. this.appendDummyInput()
  15. .appendField(Blockly.Msg.LED_SET_WORD + " PIN_YR " + Blockly.Msg.MOTOR_AS)
  16. .appendField(new Blockly.FieldTextInput("6"), "pin_yr");
  17. this.appendDummyInput()
  18. .appendField(Blockly.Msg.LED_SET_WORD + " PIN_YL " + Blockly.Msg.MOTOR_AS)
  19. .appendField(new Blockly.FieldTextInput("9"), "pin_yl");
  20. this.appendDummyInput()
  21. .appendField(Blockly.Msg.LED_SET_WORD + " INTERVALTIME " + Blockly.Msg.MOTOR_AS)
  22. .appendField(new Blockly.FieldTextInput("10.0"), "intervaltime");
  23. //this.setPreviousStatement(true, null);
  24. this.setNextStatement(true, 'biped_movement');
  25. this.setColour(180);
  26. this.setTooltip('');
  27. this.setHelpUrl('');
  28. }
  29. };
  30. Blockly.Blocks['robot_biped_movement'] = {
  31. init: function() {
  32. this.appendDummyInput()
  33. .appendField(Blockly.Msg.MOTOR_MOVEMENT + " --")
  34. .appendField(new Blockly.FieldDropdown([["Going Up","goingUp(t*2);"], ["Drunk","drunk(t*4);"], ["No Gravity","noGravity(t*2);"], ["Kick Left","kickLeft(t);"], ["Kick Right","kickRight(t);"], ["Run","run(4, t*2);"], ["Walk","walk(4, t*2);"], ["Back Yard","backyard(2, t*2);"], ["Back Yard Slow","backyardSlow(2, t*2);"], ["Turn Left","turnLeft(4, t*2);"], ["Turn RIGHT","turnRight(4, t*2);"], ["Moon Walk Left","moonWalkLeft(4, t*2);"], ["Moon Walk RIGHT","moonWalkRight(4, t*2);"], ["Crusaito","crusaito(4, t*2);"], ["Swing","swing(4, t*2);"], ["Up Down","upDown(4, t*2);"], ["Flapping","flapping(4, t*2);"], ["Segunda Parte", "segunda_parte();"], ["Primera Parte", "primera_parte();"]]), "robot_biped_movement");
  35. this.setPreviousStatement(true, 'biped_movement');
  36. this.setNextStatement(true, ['biped_movement','biped_initialize']);
  37. this.setColour(180);
  38. this.setTooltip('');
  39. this.setHelpUrl('');
  40. }
  41. };
  42. Blockly.Blocks['robot_biped_initialize'] = {
  43. init: function() {
  44. this.appendDummyInput()
  45. .appendField(Blockly.Msg.MOTOR_INITIALIZE);
  46. this.setPreviousStatement(true, 'biped_initialize');
  47. this.setColour(180);
  48. this.setTooltip('');
  49. this.setHelpUrl('');
  50. }
  51. };
  52. */