Przeglądaj źródła

refactor circleOne

lairaalmas 1 rok temu
rodzic
commit
985acac645

+ 2 - 2
src/assets/lang/en_US

@@ -1,8 +1,8 @@
 audio=AUDIO
 aux_rectangle=Auxiliar Rectangles
 circle=Circles
-circleOne_introText1=Where should the balloon be placed so the boy
-circleOne_introText2=can get to it?
+circleOne_intro1=Where should the balloon be placed so the boy
+circleOne_intro2=can get to it?
 continue=Continue
 custom_game=CUSTOMIZE THE CURRENT GAME
 difficulties=Difficulties

+ 2 - 2
src/assets/lang/es_PE

@@ -2,8 +2,8 @@ audio=AUDIO
 aux_rectangle=Rectángulos Auxiliares
 circle=Circulos
 continue=Continúa
-circleOne_introText1=¿Dónde debe estar el globo para que el niño
-circleOne_introText2= pueda alcanzarlo?
+circleOne_intro1=¿Dónde debe estar el globo para que el niño
+circleOne_intro2= pueda alcanzarlo?
 custom_game=PERSONALIZAR EL JUEGO ACTUAL
 difficulties=Dificultades
 difficulty=Dificultade

+ 2 - 2
src/assets/lang/fr_FR

@@ -2,8 +2,8 @@ audio=AUDIO
 aux_rectangle=Rectangles Auxiliaires
 circle=Cercles
 continue=Continuez
-circleOne_introText1=Où doit être le ballon pour que le garçon
-circleOne_introText2=puisse l'atteindre ?
+circleOne_intro1=Où doit être le ballon pour que le garçon
+circleOne_intro2=puisse l'atteindre ?
 custom_game=PERSONNALISER LE JEU ACTUEL
 difficulties=Difficultés
 difficulty=Difficulté

+ 2 - 2
src/assets/lang/it_IT

@@ -2,8 +2,8 @@ audio=AUDIO
 aux_rectangle=Rettangoli Ausiliari
 circle=Cerchi
 continue=Continua
-circleOne_introText1=Dove dovrebbe essere il pallone in modo che il
-circleOne_introText2=ragazzo possa raggiungerlo?
+circleOne_intro1=Dove dovrebbe essere il pallone in modo che il
+circleOne_intro2=ragazzo possa raggiungerlo?
 custom_game=PERSONALIZZA IL GIOCO ATTUALE
 difficulties=Difficoltà
 difficulty=Difficoltà

+ 2 - 2
src/assets/lang/pt_BR

@@ -1,8 +1,8 @@
 audio=ÁUDIO
 aux_rectangle=Retângulos Auxiliares
 circle=Círculos
-circleOne_introText1=Onde o balão deve ficar para que o menino
-circleOne_introText2=consiga chegar até ele?
+circleOne_intro1=Onde o balão deve ficar para que o menino
+circleOne_intro2=consiga chegar até ele?
 continue=Continue
 custom_game=PERSONALIZE O JOGO ATUAL
 difficulties=Dificuldades

+ 15 - 0
src/js/gameMechanics.js

@@ -1140,6 +1140,21 @@ const game = {
         x <= cur.xWithAnchor + cur.width * cur.scale
       );
     },
+    /**
+     * Checks if 2 images overlap
+     *
+     * @param {object} imageA image 1
+     * @param {object} imageB image 2
+     *
+     * @returns {boolean} true if there is overlap
+     */
+    isOverlap: function (imageA, imageB) {
+      const xA = imageA.x;
+      const xB = imageB.x;
+
+      // Consider it comming from both sides
+      return !(Math.abs(xA - xB) > 14);
+    },
     /**
      * Get mouse position coordinates
      *

Plik diff jest za duży
+ 459 - 470
src/js/games/circleOne.js