ソースを参照

add game sounds to continue buttons

lairaalmas 1 年間 前
コミット
c33667c490

+ 1 - 0
src/js/games/circleOne.js

@@ -1025,6 +1025,7 @@ const circleOne = {
       // Continue button
       if (self.control.showEndInfo) {
         if (game.math.isOverIcon(x, y, self.ui.continue.button)) {
+          if (audioStatus) game.audio.popSound.play();
           self.utils.endLevel();
         }
       }

+ 1 - 0
src/js/games/squareOne.js

@@ -937,6 +937,7 @@ const squareOne = {
       // Continue button
       if (self.control.showEndInfo) {
         if (game.math.isOverIcon(x, y, self.ui.continue.button)) {
+          if (audioStatus) game.audio.popSound.play();
           self.utils.endLevel();
         }
       }

+ 1 - 0
src/js/games/squareTwo.js

@@ -616,6 +616,7 @@ const squareTwo = {
       // Continue button
       if (self.control.showEndInfo) {
         if (game.math.isOverIcon(x, y, self.ui.continue.button)) {
+          if (audioStatus) game.audio.popSound.play();
           self.utils.endLevel();
         }
       }

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

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

+ 1 - 0
src/js/menus/menu_main.js

@@ -96,6 +96,7 @@ const menuState = {
         gameId = id;
         gameName = gameList[id].gameName;
         gameShape = gameList[id].gameShape;
+        audioStatus = debugState.menu.audioStatus || false;
         self.menuIcons =
           game.lang[gameShape] + ' ' + gameName.slice(-3) == 'One' ? 'I' : 'II';
         game.state.start('customMenu');

+ 1 - 0
src/js/screens/end.js

@@ -237,6 +237,7 @@ const endState = {
 
       if (self.control.waitUserAction) {
         if (game.math.isOverIcon(x, y, self.ui.continue.button)) {
+          if (audioStatus) game.audio.popSound.play();
           self.control.endLevel = true;
         }
       }

+ 1 - 0
src/js/screens/map.js

@@ -247,6 +247,7 @@ const mapState = {
     const y = game.math.getMouse(mouseEvent).y;
 
     if (game.math.isOverIcon(x, y, self.continueButton)) {
+      if (audioStatus) game.audio.popSound.play();
       self.loadGame();
     }