Bladeren bron

feature: now game s2 toggle show fraction label and always show auxiliar blocks

lairaalmas 2 maanden geleden
bovenliggende
commit
a73e10a305
4 gewijzigde bestanden met toevoegingen van 10 en 6 verwijderingen
  1. 1 1
      js/games/squareOne.js
  2. 7 4
      js/games/squareTwo.js
  3. 1 1
      js/globals/globals_control.js
  4. 1 0
      js/menus/menu_custom.js

+ 1 - 1
js/games/squareOne.js

@@ -156,7 +156,7 @@ const squareOne = {
       curIndex: -1,
       /**
        * (a) correct floor x coord - equiv to all in STACK
-       * (b) correct floor x coord - equiv to correct in STACK (fixed) (generated)
+       * (b) generated floor x coord - equiv to correct in STACK (fixed) (generated)
        */
       correctX: undefined,
     };

+ 7 - 4
js/games/squareTwo.js

@@ -245,7 +245,7 @@ const squareTwo = {
         blocks.list.push(curBlock);
 
         // Auxiliar blocks (lower alpha)
-        const alpha = showFractions ? 0.2 : 0;
+        const alpha = 0.2;
         const curYAux = y0 + self.control.blockHeight + 10;
         const curAuxBlock = game.add.geom.rect(
           curX,
@@ -268,8 +268,8 @@ const squareTwo = {
         font: 'bold ' + textStyles.h4_.font,
         fill: lineColor,
       };
-
       blocks.label = game.add.text(xLabel, yLabel, blocks.list.length, font);
+      blocks.label.alpha = showFractions ? 1 : 0;
 
       // 'selected blocks/fraction' label for (a) : at the bottom of (a)
       yLabel = y0 + self.control.blockHeight + 40;
@@ -322,6 +322,7 @@ const squareTwo = {
       );
     },
     renderOperationUI: () => {
+      // ?
       const uiList = [
         ...self.blocks.top.list,
         ...self.blocks.bottom.list,
@@ -580,7 +581,8 @@ const squareTwo = {
           self.blocks[curSet].list.length
         }`;
 
-        self.blocks[curSet].fractions[1].alpha = 1;
+        // End fraction line
+        self.blocks[curSet].fractions[1].alpha = showFractions ? 1 : 0;
 
         self.blocks[curSet].hasClicked = true; // Inform player have clicked in current block set
         self.blocks[curSet].animate = true; // Let it initiate animation
@@ -627,7 +629,8 @@ const squareTwo = {
           self.blocks[curSet].fractions[0].x = newX;
           self.blocks[curSet].fractions[1].x = newX;
 
-          self.blocks[curSet].fractions[0].alpha = 1;
+          // End fraction nominator and denominator
+          self.blocks[curSet].fractions[0].alpha = showFractions ? 1 : 0;
         }
       }
     },

+ 1 - 1
js/globals/globals_control.js

@@ -452,7 +452,7 @@ const gameList = [
           game.add.text(
             x + 5 * offsetW,
             y + offsetH + 50,
-            game.lang.show + '\n' + game.lang.aux_rectangle,
+            game.lang.show + '\n' + game.lang.title,
             textStyles.h4_
           );
         },

+ 1 - 0
js/menus/menu_custom.js

@@ -271,6 +271,7 @@ const customMenuState = {
     infoIcon.id = 'gameDifficulty';
     self.menuIcons.push(infoIcon);
 
+    // Label 'Show Fractions'
     gameList[gameId].assets.customMenu.auxiliarTitle(x, y, offsetW, offsetH);
   },