Merge branch 'master' into feature/login-page
authorgparant <g.parant@thecodingmachine.com>
Wed, 6 May 2020 00:20:28 +0000 (02:20 +0200)
committergparant <g.parant@thecodingmachine.com>
Wed, 6 May 2020 00:20:28 +0000 (02:20 +0200)
# Conflicts:
# front/src/Phaser/Game/GameScene.ts
# front/src/Phaser/Login/LogincScene.ts

1  2 
front/src/Phaser/Game/GameScene.ts
front/src/Phaser/Login/LogincScene.ts

index 39e486d1d54a7b10ab93f2a707332bf137d5e345,b0ace1fedee6400f2bdbc3175be18d8a950671b0..f449f0766117a4916d25388e3cf797c7b3571a49
@@@ -58,19 -55,11 +57,17 @@@ export class GameScene extends Phaser.S
              })
          });
          this.load.tilemapTiledJSON(Textures.Map, mapUrl);
 -        this.load.spritesheet(Textures.Player,
 -            'resources/characters/pipoya/Male 01-1.png',
 -            { frameWidth: 32, frameHeight: 32 }
 -        );
 +
 +        //add player png
 +        PLAYER_RESOURCES.forEach((playerResource: any) => {
 +            this.load.spritesheet(
 +                playerResource.name,
 +                playerResource.img,
 +                {frameWidth: 32, frameHeight: 32}
 +            );
 +        });
 +
          this.load.bitmapFont('main_font', 'resources/fonts/arcade.png', 'resources/fonts/arcade.xml');
-         cypressAsserter.preloadFinished();
      }
  
      //hook initialisation
index 3ed2f0f525e751aa1c823ccf1de0de21ee01f7e1,10c7e5dbcefc198736f05a56e9db0f03d7673fa0..7aadfbc5c049355141d15148d746230f65536f1c
@@@ -2,12 -2,9 +2,13 @@@ import {gameManager} from "../Game/Game
  import {TextField} from "../Components/TextField";
  import {TextInput} from "../Components/TextInput";
  import {ClickButton} from "../Components/ClickButton";
 -import {GameSceneName} from "../Game/GameScene";
 +import {GameSceneInterface, GameSceneName, Textures} from "../Game/GameScene";
  import Image = Phaser.GameObjects.Image;
 +import {Player} from "../Player/Player";
 +import {getPlayerAnimations, PlayerAnimationNames} from "../Player/Animation";
 +import Rectangle = Phaser.GameObjects.Rectangle;
 +import {PLAYER_RESOURCES} from "../Entity/PlayableCaracter";
+ import {cypressAsserter} from "../../Cypress/CypressAsserter";
  
  //todo: put this constants in a dedicated file
  export const LoginSceneName = "LoginScene";
@@@ -40,14 -34,7 +42,15 @@@ export class LogincScene extends Phaser
          this.load.image(LoginTextures.icon, "resources/logos/tcm_full.png");
          // Note: arcade.png from the Phaser 3 examples at: https://github.com/photonstorm/phaser3-examples/tree/master/public/assets/fonts/bitmap
          this.load.bitmapFont(LoginTextures.mainFont, 'resources/fonts/arcade.png', 'resources/fonts/arcade.xml');
+         cypressAsserter.preloadFinished();
 +        //add player png
 +        PLAYER_RESOURCES.forEach((playerResource: any) => {
 +            this.load.spritesheet(
 +                playerResource.name,
 +                playerResource.img,
 +                {frameWidth: 32, frameHeight: 32}
 +            );
 +        });
      }
  
      create() {
              }
              return this.login(name);
          });
 +
 +        /*create user*/
 +        this.createCurrentPlayer("test");
+         cypressAsserter.initFinished();
      }
  
      update(time: number, delta: number): void {