Browse Source

refactor: fix errors in floor feedback s1

lairaalmas 1 year ago
parent
commit
cecdc6294d
2 changed files with 14 additions and 10 deletions
  1. 11 7
      js/games/squareOne.js
  2. 3 3
      js/globals/globals_debug.js

+ 11 - 7
js/games/squareOne.js

@@ -681,6 +681,8 @@ const squareOne = {
             0.7
           );
           floorFlag.anchor(0, 1);
+          if (gameOperation === 'minus')
+            floorFlag.x -= self.floor.list[0].width;
         } else {
           let min = self.floor.selectedIndex,
             max = self.floor.correctIndex;
@@ -704,15 +706,17 @@ const squareOne = {
             0.7
           );
           floorFlag.anchor(0, 1);
+          if (gameOperation === 'minus')
+            floorFlag.x -= self.floor.list[0].width;
         } else {
-          let min = self.floor.selectedIndex,
-            max = self.floor.curIndex;
-          if (min < max) {
-            for (let i = min + 1; i <= max; i++) {
-              self.floor.list[i].fillColor = colors.red;
-              self.floor.list[i].alpha = 1;
-            }
+          let max = self.floor.selectedIndex,
+            min = self.floor.curIndex;
+          //if (min < max) {
+          for (let i = min + 1; i <= max; i++) {
+            self.floor.list[i].fillColor = colors.red;
+            self.floor.list[i].alpha = 1;
           }
+          //}
         }
       }
 

+ 3 - 3
js/globals/globals_debug.js

@@ -3,14 +3,14 @@ const isDebugMode = true;
 const debugState = {
   lang: { skip: true, lang: 'pt_BR' },
   name: { skip: true, name: 'Username' },
-  menu: { skip: true, id: 1, audioStatus: false },
+  menu: { skip: true, id: 0, audioStatus: false },
   customMenu: {
     skip: true,
     getData: () => {
-      return { mode: 'a', operation: 'plus', difficulty: 2, label: true };
+      return { mode: 'b', operation: 'minus', difficulty: 1, label: true };
     },
   },
-  map: { skip: false },
+  map: { skip: true },
   end: { skip: false, stop: false },
   moodle: {
     emulate: false,