Quellcode durchsuchen

creating new game

lairaalmas vor 1 Jahr
Ursprung
Commit
42c58000c4
32 geänderte Dateien mit 310 neuen und 691 gelöschten Zeilen
  1. BIN
      src/assets/img/character/scale/scale_base.png
  2. BIN
      src/assets/img/character/scale/scale_plate.png
  3. BIN
      src/assets/img/character/scale/scale_top.png
  4. BIN
      src/assets/img/interac_icon/button.png
  5. BIN
      src/assets/img/scene/.png
  6. BIN
      src/assets/img/scene/bg_snow.png
  7. BIN
      src/assets/img/scene/bricks/brick_1.png
  8. BIN
      src/assets/img/scene/bricks/brick_10.png
  9. BIN
      src/assets/img/scene/bricks/brick_11.png
  10. BIN
      src/assets/img/scene/bricks/brick_12.png
  11. BIN
      src/assets/img/scene/bricks/brick_13.png
  12. BIN
      src/assets/img/scene/bricks/brick_14.png
  13. BIN
      src/assets/img/scene/bricks/brick_15.png
  14. BIN
      src/assets/img/scene/bricks/brick_16.png
  15. BIN
      src/assets/img/scene/bricks/brick_2.png
  16. BIN
      src/assets/img/scene/bricks/brick_3.png
  17. BIN
      src/assets/img/scene/bricks/brick_4.png
  18. BIN
      src/assets/img/scene/bricks/brick_5.png
  19. BIN
      src/assets/img/scene/bricks/brick_6.png
  20. BIN
      src/assets/img/scene/bricks/brick_7.png
  21. BIN
      src/assets/img/scene/bricks/brick_8.png
  22. BIN
      src/assets/img/scene/bricks/brick_9.png
  23. BIN
      src/assets/img/scene/floor_snow.png
  24. BIN
      src/assets/img/scene/floor_stone.png
  25. BIN
      src/assets/img/scene/floor_stone_left.png
  26. BIN
      src/assets/img/scene/floor_stone_right.png
  27. BIN
      src/assets/img/scene/stone_shelf.png
  28. BIN
      src/assets/img/scene/wood_shelf.png
  29. 250 688
      src/js/games/scaleOne.js
  30. 48 0
      src/js/globals/globals_functions.js
  31. 11 1
      src/js/globals/globals_tokens.js
  32. 1 2
      src/js/menus/preMenu_name.js

BIN
src/assets/img/character/scale/scale_base.png


BIN
src/assets/img/character/scale/scale_plate.png


BIN
src/assets/img/character/scale/scale_top.png


BIN
src/assets/img/interac_icon/button.png


BIN
src/assets/img/scene/.png


BIN
src/assets/img/scene/bg_snow.png


BIN
src/assets/img/scene/bricks/brick_1.png


BIN
src/assets/img/scene/bricks/brick_10.png


BIN
src/assets/img/scene/bricks/brick_11.png


BIN
src/assets/img/scene/bricks/brick_12.png


BIN
src/assets/img/scene/bricks/brick_13.png


BIN
src/assets/img/scene/bricks/brick_14.png


BIN
src/assets/img/scene/bricks/brick_15.png


BIN
src/assets/img/scene/bricks/brick_16.png


BIN
src/assets/img/scene/bricks/brick_2.png


BIN
src/assets/img/scene/bricks/brick_3.png


BIN
src/assets/img/scene/bricks/brick_4.png


BIN
src/assets/img/scene/bricks/brick_5.png


BIN
src/assets/img/scene/bricks/brick_6.png


BIN
src/assets/img/scene/bricks/brick_7.png


BIN
src/assets/img/scene/bricks/brick_8.png


BIN
src/assets/img/scene/bricks/brick_9.png


BIN
src/assets/img/scene/floor_snow.png


BIN
src/assets/img/scene/floor_stone.png


BIN
src/assets/img/scene/floor_stone_left.png


BIN
src/assets/img/scene/floor_stone_right.png


BIN
src/assets/img/scene/stone_shelf.png


BIN
src/assets/img/scene/wood_shelf.png


Datei-Diff unterdrückt, da er zu groß ist
+ 250 - 688
src/js/games/scaleOne.js


+ 48 - 0
src/js/globals/globals_functions.js

@@ -283,6 +283,47 @@ const renderBackground = (type) => {
       colors.blueBg,
       1
     );
+  } else if (type === 'scale') {
+    // Add background image
+    game.add.image(0, 0, 'bg_snow', 1.8);
+
+    const floor = {
+      width: 128,
+      last: context.canvas.width / 128,
+      tiles: [3, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 4],
+    };
+
+    for (let i = 0; i < floor.tiles.length; i++) {
+      game.add
+        .sprite(i * floor.width, context.canvas.height, 'floor_snow', 0, 2)
+        .anchor(0, 1);
+      game.add
+        .sprite(
+          i * floor.width,
+          context.canvas.height - 65,
+          'floor_snow',
+          floor.tiles[i],
+          2
+        )
+        .anchor(0, 1);
+    }
+
+    game.add
+      .image(-2, context.canvas.height - 410, 'wood_shelf', 2)
+      .anchor(0, 1);
+    game.add
+      .image(-2, context.canvas.height - 650, 'wood_shelf', 2)
+      .anchor(0, 1);
+
+    game.add
+      .sprite(4 * floor.width, context.canvas.height - 65, 'floor_snow', 7, 2)
+      .anchor(0, 1);
+    game.add
+      .sprite(8 * floor.width, context.canvas.height - 65, 'floor_snow', 8, 2)
+      .anchor(0, 1);
+    game.add
+      .sprite(13 * floor.width, context.canvas.height - 65, 'floor_snow', 7, 2)
+      .anchor(0, 1);
   } else {
     // Add background image
     game.add.image(0, 0, 'bgimage', 2.2);
@@ -359,3 +400,10 @@ const debug = {
     }
   },
 };
+
+const moveList = function (list, x, y) {
+  list.forEach((item) => {
+    item.x += x;
+    item.y += y;
+  });
+};

+ 11 - 1
src/js/globals/globals_tokens.js

@@ -279,11 +279,16 @@ const url = {
     image: [
       // Scene
       ['bgimage', medSrc + 'scene/bg.jpg'],
+      ['bg_snow', medSrc + 'scene/bg_snow.png'],
       ['bgmap', medSrc + 'scene/bg_map.png'],
       ['broken_sign', medSrc + 'scene/broken_sign.png'],
       ['bush', medSrc + 'scene/bush.png'],
       ['cloud', medSrc + 'scene/cloud.png'],
       ['floor', medSrc + 'scene/floor.png'],
+      ['floor_stone', medSrc + 'scene/floor_stone.png'],
+      ['floor_stone_left', medSrc + 'scene/floor_stone_left.png'],
+      ['floor_stone_right', medSrc + 'scene/floor_stone_right.png'],
+      ['wood_shelf', medSrc + 'scene/wood_shelf.png'],
       ['place_off', medSrc + 'scene/place_off.png'],
       ['place_on', medSrc + 'scene/place_on.png'],
       ['rock', medSrc + 'scene/rock.png'],
@@ -312,6 +317,7 @@ const url = {
       ['help_pointer', medSrc + 'interac_icon/pointer.png'],
       ['info', medSrc + 'interac_icon/info.png'],
       ['ok', medSrc + 'interac_icon/ok.png'],
+      ['button', medSrc + 'interac_icon/button.png'],
       // Menu icons - Games
       ['game0', medSrc + 'levels/squareOne.png'], // Square I
       ['game1', medSrc + 'levels/circleOne.png'], // Circle I
@@ -349,7 +355,6 @@ const url = {
       ['audio', medSrc + 'navig_icon/audio.png', 2],
       // Interactive icons
       ['select', medSrc + 'interac_icon/selection_box.png', 2],
-      ['button', medSrc + 'interac_icon/button.png', 2],
       ['btn_square', medSrc + 'interac_icon/button_square.png', 2],
       // Menu icons - Game modes
       ['mode0', medSrc + 'levels/squareOne_1.png', 2], // Square I : A
@@ -420,10 +425,15 @@ const url = {
       // Map buildings
       ['farm', medSrc + 'scene/farm.png'],
       ['garage', medSrc + 'scene/garage.png'],
+
+      ['scale_base', medSrc + 'character/scale/scale_base.png'],
+      ['scale_top', medSrc + 'character/scale/scale_top.png'],
+      ['scale_plate', medSrc + 'character/scale/scale_plate.png'],
     ],
     sprite: [
       // Game sprites
       ['tractor', medSrc + 'character/tractor/tractor.png', 15],
+      ['floor_snow', medSrc + 'scene/floor_snow.png', 9],
     ],
     audio: [],
   },

+ 1 - 2
src/js/menus/preMenu_name.js

@@ -28,11 +28,10 @@ const nameState = {
       textStyles.h4_brown
     );
 
-    this.okBtn = game.add.sprite(
+    this.okBtn = game.add.image(
       context.canvas.width / 2,
       context.canvas.height / 2 + 93 + 44,
       'button',
-      0,
       1.5
     );
     this.okBtn.anchor(0.5, 0.5);