Parcourir la source

refactor intro text in circleOne

lairaalmas il y a 1 an
Parent
commit
8ded672688

+ 2 - 0
src/assets/lang/en_US

@@ -1,6 +1,8 @@
 audio=AUDIO
 aux_rectangle=Auxiliar Rectangles
 circle=Circles
+circleOne_introText1=Where should the balloon be placed so the boy
+circleOne_introText2=can get to it?
 continue=Continue
 custom_game=CUSTOMIZE THE CURRENT GAME
 difficulties=Difficulties

+ 2 - 0
src/assets/lang/es_PE

@@ -2,6 +2,8 @@ audio=AUDIO
 aux_rectangle=Rectángulos Auxiliares
 circle=Circulos
 continue=Continúa
+circleOne_introText1=¿Dónde debe estar el globo para que el niño
+circleOne_introText2= pueda alcanzarlo?
 custom_game=PERSONALIZAR EL JUEGO ACTUAL
 difficulties=Dificultades
 difficulty=Dificultade

+ 2 - 0
src/assets/lang/fr_FR

@@ -2,6 +2,8 @@ audio=AUDIO
 aux_rectangle=Rectangles Auxiliaires
 circle=Cercles
 continue=Continuez
+circleOne_introText1=Où doit être le ballon pour que le garçon
+circleOne_introText2=puisse l'atteindre ?
 custom_game=PERSONNALISER LE JEU ACTUEL
 difficulties=Difficultés
 difficulty=Difficulté

+ 2 - 0
src/assets/lang/it_IT

@@ -2,6 +2,8 @@ audio=AUDIO
 aux_rectangle=Rettangoli Ausiliari
 circle=Cerchi
 continue=Continua
+circleOne_introText1=Dove dovrebbe essere il pallone in modo che il
+circleOne_introText2=ragazzo possa raggiungerlo?
 custom_game=PERSONALIZZA IL GIOCO ATTUALE
 difficulties=Difficoltà
 difficulty=Difficoltà

+ 2 - 0
src/assets/lang/pt_BR

@@ -1,6 +1,8 @@
 audio=ÁUDIO
 aux_rectangle=Retângulos Auxiliares
 circle=Círculos
+circleOne_introText1=Onde o balão deve ficar para que o menino
+circleOne_introText2=consiga chegar até ele?
 continue=Continue
 custom_game=PERSONALIZE O JOGO ATUAL
 difficulties=Dificuldades

+ 22 - 8
src/js/games/circleOne.js

@@ -154,12 +154,23 @@ const circleOne = {
     this.help.anchor(0.5, 0);
     this.help.alpha = 0;
 
+    this.introText = [];
     // Text
-    game.add.text(
-      context.canvas.width / 2,
-      200,
-      'Onde o balão deve ficar para que o menino consiga chegar até ele?',
-      textStyles.h1_
+    this.introText.push(
+      game.add.text(
+        context.canvas.width / 2,
+        170,
+        game.lang.circleOne_introText1,
+        textStyles.h1_
+      )
+    );
+    this.introText.push(
+      game.add.text(
+        context.canvas.width / 2,
+        220,
+        game.lang.circleOne_introText2,
+        textStyles.h1_
+      )
     );
 
     if (!this.restart) {
@@ -456,7 +467,7 @@ const circleOne = {
         game.add.text(
           validPath.x0 +
             i * validPath.distanceBetweenPoints * directionModifier,
-          validPath.y0 + 55,
+          validPath.y0 + 60,
           i * directionModifier,
           {
             ...textStyles.h2_,
@@ -619,7 +630,7 @@ const circleOne = {
           ];
         }
 
-        if (fractionLabel) {
+        if (showFractions) {
           for (let cur in curFractionItems) {
             curCircleInfo.label.push(
               game.add.text(
@@ -794,7 +805,7 @@ const circleOne = {
         if (audioStatus) game.audio.popSound.play();
 
         // Hide fractions
-        if (fractionLabel) {
+        if (showFractions) {
           self.circles.list.forEach((circle) => {
             circle.info.label.forEach((labelPart) => {
               labelPart.alpha = 0;
@@ -805,6 +816,9 @@ const circleOne = {
         // Hide solution pointer
         if (self.help != undefined) self.help.alpha = 0;
 
+        self.introText[0].alpha = 0;
+        self.introText[1].alpha = 0;
+
         self.balloon.alpha = 1;
         self.walkedPath.alpha = 1;
 

+ 2 - 2
src/js/games/squareOne.js

@@ -420,7 +420,7 @@ const squareOne = {
       if (audioStatus) game.audio.popSound.play();
 
       // Hide labels
-      if (fractionLabel) {
+      if (showFractions) {
         self.stck.labels.forEach((cur) => {
           cur.forEach((cur) => {
             cur.alpha = 0;
@@ -489,7 +489,7 @@ const squareOne = {
       self.stck.blocks.push(block);
 
       // If 'show fractions' is turned on, create labels that display the fractions on the side of each block
-      if (fractionLabel) {
+      if (showFractions) {
         const x = self.startX + (curBlockWidth + 15) * self.direc_level;
         const y = self.defaultBlockHeight - lineSize;
 

+ 2 - 2
src/js/games/squareTwo.js

@@ -179,7 +179,7 @@ const squareTwo = {
       this.a.blocks.push(block);
 
       // Auxiliar blocks
-      const alpha = fractionLabel ? 0.1 : 0;
+      const alpha = showFractions ? 0.1 : 0;
 
       const yAux = yA + figureHeight + 10; // On the bottom of (a)
       const auxBlock = game.add.geom.rect(
@@ -247,7 +247,7 @@ const squareTwo = {
       this.b.blocks.push(block);
 
       // Auxiliar blocks
-      const alpha = fractionLabel ? 0.1 : 0;
+      const alpha = showFractions ? 0.1 : 0;
       const yAux = yB + figureHeight + 10; // On the bottom of (b)
       const auxBlock = game.add.geom.rect(
         x,

+ 1 - 1
src/js/globals/globals_control.js

@@ -95,7 +95,7 @@ let gameDifficulty;
  * Turns displaying the fraction labels on levels ON/OFF
  * @type {boolean}
  */
-let fractionLabel = true;
+let showFractions = true;
 
 /**
  * When true, the character can move to next position in the map

+ 5 - 5
src/js/globals/globals_debug.js

@@ -1,16 +1,16 @@
 const isDebugMode = true;
 
 const debugState = {
-  lang: { status: false, lang: 'pt_BR' },
-  name: { status: false, name: 'Username' },
-  menu: { status: false, id: 1 },
+  lang: { status: true, lang: 'fr_FR' },
+  name: { status: true, name: 'Username' },
+  menu: { status: true, id: 1 },
   customMenu: {
-    status: false,
+    status: true,
     getData: () => {
       return { mode: 'a', operation: 'mixed', difficulty: 3, label: true };
     },
   },
-  map: { status: false },
+  map: { status: true },
   end: { status: false, stop: false },
 };
 

+ 5 - 5
src/js/menus/menu_custom.js

@@ -78,7 +78,7 @@ const customMenuState = {
         gameMode = mode;
         gameOperation = operation;
         gameDifficulty = difficulty || 1;
-        fractionLabel = label || true;
+        showFractions = label || true;
 
         curMapPosition = 0; // Map position
         canGoToNextMapPosition = true; // Move no next point
@@ -114,10 +114,10 @@ const customMenuState = {
       case 'selectionBox':
         if (icon.curFrame == 0) {
           icon.curFrame = 1;
-          fractionLabel = true;
+          showFractions = true;
         } else {
           icon.curFrame = 0;
-          fractionLabel = false;
+          showFractions = false;
         }
         game.render.all();
         break;
@@ -132,7 +132,7 @@ const customMenuState = {
               '\nGame Difficulty: ' +
               gameDifficulty +
               '\nDisplay Fraction Labels: ' +
-              fractionLabel +
+              showFractions +
               '\n------------------------------'
           );
         }
@@ -301,7 +301,7 @@ const customMenuState = {
 
   renderCheckBox: function (x, y, offsetW, offsetH) {
     y += 40;
-    const frame = fractionLabel ? 1 : 0;
+    const frame = showFractions ? 1 : 0;
 
     const selectionBox = game.add.sprite(
       x + 5 * offsetW,

+ 5 - 5
src/js/moodle/integrationFunctions.js

@@ -50,8 +50,8 @@ function getAnswer() {
       gameOperation +
       '\ngameDifficulty:' +
       gameDifficulty +
-      '\nfractionLabel:' +
-      fractionLabel +
+      '\nshowFractions:' +
+      showFractions +
       '\nresults:';
     for (let i = 0; i < moodleVar.hits.length; i++) {
       str +=
@@ -85,8 +85,8 @@ function getAnswer() {
       gameOperation +
       '\ngameDifficulty:' +
       gameDifficulty +
-      '\nfractionLabel:' +
-      fractionLabel;
+      '\nshowFractions:' +
+      showFractions;
   }
 
   return str;
@@ -241,7 +241,7 @@ const updateGlobalVariables = function (infoGame, infoResults) {
   gameMode = infoGame['gameMode'];
   gameOperation = infoGame['gameOperation'];
   gameDifficulty = parseInt(infoGame['gameDifficulty']);
-  fractionLabel = infoGame['fractionLabel'];
+  showFractions = infoGame['showFractions'];
   // Update default values
   curMapPosition = 0;
   canGoToNextMapPosition = true;