فهرست منبع

Merge branch 'master' of ssh://200.144.254.107:2245/LInE/Ifractions-web into fix/moodle-bugs

lairaalmas 1 سال پیش
والد
کامیت
e4e188c430
3فایلهای تغییر یافته به همراه44 افزوده شده و 5 حذف شده
  1. 33 0
      README.md
  2. 5 4
      js/gameMechanics.js
  3. 6 1
      js/menus/menu_main.js

+ 33 - 0
README.md

@@ -44,3 +44,36 @@ Follow the description below based on in which platform you want to run iFractio
 
   * get the automatic evaluation for the activities
 
+## Releases:
+
+### A new version will be available soon!
+
+* Bug fixes 
+
+* GUI changes
+
+* Code refactoring
+
+### [v2.0.0](http://200.144.254.107/git/LInE/Ifractions-web/src/release-2.0.0) (stable)
+
+* Bug fixes
+
+* No longer uses Phaser.io
+
+  * Now iFractions implements its own game mechanics
+
+* Add Moodle integration
+
+  * Now iFractions is a part of the iAssign package and can be integrated to Moodle
+
+* New available language: Italian
+
+* GUI changes
+
+* Code refactoring and documenting
+
+### [v1.0.0](http://200.144.254.107/git/LInE/Ifractions-web/src/release-1.0.0) (deprecated)
+
+* Uses Phaser.io to handle game mechanics
+
+* Available languages: Spanish, Portuguese, English and French.

+ 5 - 4
js/gameMechanics.js

@@ -122,7 +122,7 @@ const game = {
       } else {
         self.create(); // Calls create()
         game.render.all(); // After create() ends, renders media on canvas
-        if (self?.restart) {
+        if (self && self.restart) {
           // If needed, restart state
           game.state.start(game.state.name);
         } else {
@@ -510,9 +510,10 @@ const game = {
       } else {
         const med = {
           typeOfMedia: 'text',
-          name: style?.increaseLetterSpacing
-            ? text.split('').join(String.fromCharCode(8202))
-            : text,
+          name:
+            style && style.increaseLetterSpacing
+              ? text.split('').join(String.fromCharCode(8202))
+              : text,
 
           x: x || game.add.default.x,
           y: y || game.add.default.y,

+ 6 - 1
js/menus/menu_main.js

@@ -137,7 +137,12 @@ const menuState = {
    * Displays game menu information boxes.
    */
   showInfoBox: function (icon) {
-    if (gameList?.[icon.id]?.assets?.menu?.infoBox) {
+    if (
+      gameList[icon.id] &&
+      gameList[icon.id].assets &&
+      gameList[icon.id].assets.menu &&
+      gameList[icon.id].assets.menu.infoBox
+    ) {
       self.infoBox.style.display = 'block';
 
       const data = gameList[icon.id].assets.menu.infoBox();