text: import {game} from '../index';
  import {configTextOverlay, background, placingDownMore, placingRectangleProgress, placingRectangleOverlay, placingTextOverlay, placingDownRightIcon, placingDownLeftIcon, touchIcon, placingHandPointer, appearance, disappearance, moveDownRectangleOverlay, moveDownTextOverlay, moveUpHandPointer, appearanceIcon, appearanceIconLight, disappearanceIconLight, moveDownHandPointer, moveUpRectangleOverlay, moveUpTextOverlay} from './main';
  
  export class SceneCostumeBagBlueNecklace extends Phaser.Scene {
      constructor() {
          super('SceneCostumeBagBlueNecklace');
      }
   
      create() {
          let bg = this.add.sprite(0, 0, "sprite", "background.jpg");
          let body = this.add.sprite(0, 0, "sprite", "body.png");
          let animationShy = this.add.sprite(0, 0, "sprite", "animationShy.png");
          animationShy.visible = false;
          let animationJoy = this.add.sprite(0, 0, "sprite", "animationJoy.png");
          animationJoy.visible = false;        
          let costume = this.add.sprite(0, 0, "sprite", "costume.png");
          let bagBlue = this.add.sprite(0, 0, "sprite", "bagBlue.png");
          let necklace = this.add.sprite(0, 0, "sprite", "necklace.png");
          let hair = this.add.sprite(0, 0, "sprite", "hair.png");
          let rectangleOverlay = this.add.sprite(0, 0, "sprite", "rectangleOverlay.png");
          let progress3 = this.add.sprite(0, 0, "sprite", "progress3.jpg");
          let textOverlay = this.add.text(0, 0, `Choose your place`, configTextOverlay);        
          let rectangleLightRight = this.physics.add.sprite(0, 0, "sprite", "rectangleLight.png").setDebug(false);
          let rectangleLightLeft = this.physics.add.sprite(0, 0, "sprite", "rectangleLight.png").setDebug(false);        
          let rectangleNightClub = this.physics.add.sprite(0, 0, "sprite", "rectangleNightClub.png").setInteractive().setDebug(false);
          let rectangleClub = this.physics.add.sprite(0, 0, "sprite", "rectangleClub.png").setInteractive().setDebug(false);
          let handPointer = this.physics.add.sprite(0, 0, "sprite", "hand.png");
  
          placing();
  
          function placing() {
              background(bg);
              placingDownMore(body);
              placingDownMore(animationShy);  
              placingDownMore(animationJoy);                    
              placingDownMore(costume);
              placingDownMore(bagBlue);
              placingDownMore(necklace);
              placingDownMore(hair);
              placingRectangleProgress(progress3);
              placingRectangleOverlay(rectangleOverlay);
              placingTextOverlay(textOverlay);
              placingDownRightIcon(rectangleLightRight);
              placingDownRightIcon(rectangleClub);
              placingDownLeftIcon(rectangleLightLeft);
              placingDownLeftIcon(rectangleNightClub);           
              placingHandPointer(handPointer);
          };
  
          this.scale.on('resize', placing, this);
          
          appearance(15, progress3);
          disappearance(15, progress3, 1500);
          moveDownRectangleOverlay(15, rectangleOverlay);
          moveDownTextOverlay(15, textOverlay);
          moveUpHandPointer(15, handPointer);
          appearanceIcon(15, rectangleClub, 100);
          appearanceIcon(15, rectangleNightClub, 0);
          appearanceIcon(15, rectangleLightRight, 100);
          appearanceIcon(15, rectangleLightLeft, 0);
          handPointer.setSize(1, 1).setOffset(0);
  
          setTimeout(() => { animationShy.visible = true}, 2000);
  
          this.physics.add.overlap(handPointer, rectangleNightClub, function() {
              appearanceIconLight(15, rectangleLightRight);
              disappearanceIconLight(15, rectangleLightLeft)
          });
          this.physics.add.overlap(handPointer, rectangleClub, function() {
              appearanceIconLight(15, rectangleLightLeft);
              disappearanceIconLight(15, rectangleLightRight)
          });
  
          rectangleNightClub.on('pointerdown', () => {
              touchIcon(15, rectangleNightClub, rectangleClub);
              rectangleLightRight.visible = false;
              rectangleLightLeft.visible = false;
              moveDownHandPointer(15, handPointer);
              moveUpRectangleOverlay(15, rectangleOverlay);
              moveUpTextOverlay(15, textOverlay);
              animationJoy.visible = true;
  
              setTimeout(() => { this.scene.start("SceneLoseScreen", { clothes: costume, bag: bagBlue, accessory: necklace, place: "nightClub.jpg" }) }, 500);
          });
  
          rectangleClub.on('pointerdown', () => {
              touchIcon(15, rectangleClub, rectangleNightClub);
              rectangleLightRight.visible = false;
              rectangleLightLeft.visible = false;
              moveDownHandPointer(15, handPointer);
              moveUpRectangleOverlay(15, rectangleOverlay);
              moveUpTextOverlay(15, textOverlay);
              animationJoy.visible = true;
  
              setTimeout(() => { this.scene.start("SceneLoseScreen", { clothes: costume, bag: bagBlue, accessory: necklace, place: "club.jpg" }) }, 500);
          });        
      }
  }