Jelajahi Sumber

Update 'src/index.html'

Added messages and try/catch to help debug process
leo 8 bulan lalu
induk
melakukan
91f7b9b6b6
1 mengubah file dengan 13 tambahan dan 0 penghapusan
  1. 13 0
      src/index.html

+ 13 - 0
src/index.html

@@ -54,9 +54,12 @@
     <script src="./js/globals/globals_functions.js"></script>
     <script src="./js/globals/globals_debug.js"></script>
     <script>
+    var msgDebug = "";
+    try {
       const defaultWidth = 1920; // Default width for the Canvas
       const defaultHeight = 1080; // Default height for the Canvas
 
+      msgDebug += "1, ";
       const context = document.querySelector('.ifr-canvas').getContext("2d");
       context.canvas.width = defaultWidth;
       context.canvas.height = defaultHeight;
@@ -67,21 +70,31 @@
       game.state.add('loadLang', loadLangState);
       game.state.add('name', nameState);
 
+      msgDebug += "2, ";
       game.state.add('menu', menuState);
       game.state.add('customMenu', customMenuState);
 
+      msgDebug += "3, ";
       game.state.add('map', mapState);
       game.state.add('end', endState);
 
+      msgDebug += "4, ";
       game.state.add('squareOne', squareOne);
       game.state.add('circleOne', circleOne);
       game.state.add('squareTwo', squareTwo);
       // game.state.add('scaleOne', scaleOne);
 
+      msgDebug += "5, ";
       game.state.add('studentReport', studentReport); // FOR MOODLE
 
+      msgDebug += "6, ";
       // CALLING FIRST GAME STATE
       game.state.start('boot');
+      console.log('iFractions/LInE');
+    } catch (error) {
+      console.log('iFractions/LInE: error ' + error);
+      console.log(msgDebug);
+      }
     </script>
   </div>