Skip to content

Commit

Permalink
blocks first
Browse files Browse the repository at this point in the history
  • Loading branch information
danielferro69 committed May 10, 2024
1 parent cfd3678 commit 457322e
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 2 deletions.
8 changes: 7 additions & 1 deletion locales/en-us/blocks.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@
"while": "Repeat until",
"chargerHere": "Is there a charger here?",
"trophyHere": "Is there a trophy here?",
"saladBowlHere": "Is there a salad bowl here?"
"saladBowlHere": "Is there a salad bowl here?",
"writeA": "Write 'A'",
"writeB": "Write 'B'",
"writeC": "Write 'C'",
"puddleHere": "Is there a puddle here?",
"write": "'%1 write: %2'",
"currentCharacter": "'%1 Is the current letter an %2 ?'"
},
"procedures": {
"definition": "Define",
Expand Down
8 changes: 7 additions & 1 deletion locales/es-ar/blocks.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@
"while": "Repetir hasta que",
"chargerHere": "¿Hay un cargador acá?",
"trophyHere": "¿Hay un trofeo acá?",
"saladBowlHere": "¿Hay una ensaladera acá?"
"saladBowlHere": "¿Hay una ensaladera acá?",
"writeA": "Escribir 'A'",
"writeB": "Escribir 'B'",
"writeC": "Escribir 'C'",
"puddleHere": "¿Hay un charco?",
"write": "'%1 Escribir: %2'",
"currentCharacter": "'%1 ¿La letra actual es una %2 ?'"
},
"procedures": {
"definition": "Definir",
Expand Down
58 changes: 58 additions & 0 deletions src/components/blockly/blockly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,24 @@ const createPrimitiveBlocks = (t: (key: string) => string) => {
}, 'icono.abajo.png'
);

createPrimitiveBlock('EscribirA', t("blocks.writeA"), {
'comportamiento': 'EscribirEnComputadora',
'argumentos': '{idTransicion: "escribirA"}',
}, 'icono.letter-a.svg'
);

createPrimitiveBlock('EscribirB', t("blocks.writeB"), {
'comportamiento': 'EscribirEnComputadora',
'argumentos': '{idTransicion: "escribirB"}',
}, 'icono.letter-b.svg'
);

createPrimitiveBlock('EscribirC', t("blocks.writeC"), {
'comportamiento': 'EscribirEnComputadora',
'argumentos': '{idTransicion: "escribirC"}',
}, 'icono.letter-c.svg'
);

createPrimitiveBlock('MoverA', t(`blocks.moveTo`), { 'comportamiento': '', 'argumentos': '{}' }, '',
{
message0: `${t(`blocks.moveTo`)} %1`,
Expand Down Expand Up @@ -765,6 +783,22 @@ const createPrimitiveBlocks = (t: (key: string) => string) => {
`
});

createPrimitiveBlock('EscribirTextoDadoEnOtraCuadricula', t(`blocks.write`), { 'comportamiento': '', 'argumentos': '{}' }, 'icono.DibujarLinea.png',
{
message0: `${t(`write`)}`,
colour: primitivesColor,
inputsInline: true,
previousStatement: true,
nextStatement: true,
args0: [
{
"type": "field_input",
"name": "texto",
"text": ""
}
],
code: 'hacer(actor_id, "EscribirTextoDadoEnOtraCuadricula", {texto: "texto"});'
});
}

const createSensorBlocks = (t: (key: string) => string) => {
Expand Down Expand Up @@ -986,6 +1020,30 @@ const createSensorBlocks = (t: (key: string) => string) => {
'funcionSensor': 'tocando("Trofeo")',
}, 'icono.trofeo.png'
);
createSensorBlock('HayCharco', t('blocks.puddleHere'), {
'funcionSensor': 'hayEnEscena("Charco")',
}, 'icono.charco.png'
);

createSensorBlock('HayVocalRMT', t('blocks.currentCharacter'), {
'funcionSensor': '{}',
}, 'icono.DibujarLinea.png',
{
message0: `${t(`blocks.currentCharacter`)}`,
colour: sensorsColor,
args0: [
{
"type": "field_dropdown",
"name": "letra",
"options": [
["R", "r"], ["M", "m"], ["T", "t"], ["A", "a"], ["E", "e"], ["I", "i"], ["O", "o"], ["U", "u"]
]
}
],
"output": null,
code: 'hacer(actor_id, "Rotar", {angulo: - ($grados), voltearAlIrAIzquierda: false, velocidad: 60});',
}
);
}

const createValueBlocks = (t: (key: string) => string) => {
Expand Down

0 comments on commit 457322e

Please sign in to comment.