Browse Source

refactor: add text with paragraph in level intro texts

lairaalmas 1 year ago
parent
commit
2ca3de064a
3 changed files with 13 additions and 17 deletions
  1. 1 9
      src/js/games/circleOne.js
  2. 6 4
      src/js/games/squareOne.js
  3. 6 4
      src/js/games/squareTwo.js

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

@@ -548,15 +548,7 @@ const circleOne = {
         game.add.text(
           context.canvas.width / 2,
           170,
-          treatedMessage[0],
-          textStyles.h1_
-        )
-      );
-      self.ui.message.push(
-        game.add.text(
-          context.canvas.width / 2,
-          220,
-          treatedMessage[1],
+          treatedMessage[0] + '\n' + treatedMessage[1],
           textStyles.h1_
         )
       );

+ 6 - 4
src/js/games/squareOne.js

@@ -487,10 +487,12 @@ const squareOne = {
       const font = textStyles.h1_;
       self.ui.message = [];
       self.ui.message.push(
-        game.add.text(context.canvas.width / 2, 170, treatedMessage[0], font)
-      );
-      self.ui.message.push(
-        game.add.text(context.canvas.width / 2, 220, treatedMessage[1], font)
+        game.add.text(
+          context.canvas.width / 2,
+          170,
+          treatedMessage[0] + '\n' + treatedMessage[1],
+          font
+        )
       );
     },
     renderOperationUI: () => {

+ 6 - 4
src/js/games/squareTwo.js

@@ -295,10 +295,12 @@ const squareTwo = {
       const font = textStyles.h1_;
       self.ui.message = [];
       self.ui.message.push(
-        game.add.text(context.canvas.width / 2, 170, treatedMessage[0], font)
-      );
-      self.ui.message.push(
-        game.add.text(context.canvas.width / 2, 220, treatedMessage[1], font)
+        game.add.text(
+          context.canvas.width / 2,
+          170,
+          treatedMessage[0] + '\n' + treatedMessage[1],
+          font
+        )
       );
     },
     renderOperationUI: () => {