林旭祥 1 месяц назад
Родитель
Сommit
9f4b9ce2a8
1 измененных файлов с 24 добавлено и 24 удалено
  1. 24 24
      src/views/game/fruit.vue

+ 24 - 24
src/views/game/fruit.vue

@@ -235,8 +235,7 @@ class Bomb {
     const texture = bitmap.generateTexture('flameParticle', 50, 50);
 
     // 粒子发射器
-    this.bombEmit = this.game.add.particles(texture.key);
-    this.bombEmit.createEmitter({
+    this.bombEmit = this.game.add.particles(0, 0, texture.key, {
       x: -30,
       y: -30,
       speed: { min: -100, max: 100 },
@@ -403,7 +402,8 @@ class Fruit {
     this.bitmap = this.game.make.graphics({ x: 0, y: 0, add: false });
 
     // 粒子发射器
-    this.emitter = this.game.add.particles('flameParticle');
+    this.emitter = this.game.add.particles(0, 0, 'flameParticle', {
+      });
   }
 
   half(deg, shouldEmit = false) {
@@ -448,8 +448,8 @@ class Fruit {
       this.generateFlame(this.bitmap, emitColor);
       const texture = this.bitmap.generateTexture('fruitParticle', 60, 60);
 
-      this.emitter = this.game.add.particles(texture.key);
-      this.emitter.createEmitter({
+
+      this.emitter = this.game.add.particles(0, 0, texture.key, {
         x: this.sprite.x,
         y: this.sprite.y,
         speed: { min: -400, max: 400 },
@@ -1068,25 +1068,25 @@ class PlayScene extends Phaser.Scene {
       delay: 1000
     });
 
-this.tweens.chain({
-  targets: lose,
-  tweens: [
-    {
-      scale: 1,
-      duration: 300,
-      ease: 'Sine.InOut'
-    },
-    {
-      scale: 0,
-      duration: 300,
-      ease: 'Sine.InOut',
-      delay: 1000,
-      onComplete: () => {
-        lose.destroy();
-      }
-    }
-  ]
-});
+    this.tweens.chain({
+      targets: lose,
+      tweens: [
+        {
+          scale: 1,
+          duration: 300,
+          ease: 'Sine.InOut'
+        },
+        {
+          scale: 0,
+          duration: 300,
+          ease: 'Sine.InOut',
+          delay: 1000,
+          onComplete: () => {
+            lose.destroy();
+          }
+        }
+      ]
+    });
     tweenShow.play();
 
     tweenHide.on('complete', () => {