From cf34e4daed59e840ee7d1ee7a7c900a7c6bf1d47 Mon Sep 17 00:00:00 2001 From: neki-dev Date: Fri, 3 Nov 2023 19:03:53 +0300 Subject: [PATCH] Fixed effects --- src/game/scenes/world/effects/particles.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/game/scenes/world/effects/particles.ts b/src/game/scenes/world/effects/particles.ts index 6be6c41f..312cbb6f 100644 --- a/src/game/scenes/world/effects/particles.ts +++ b/src/game/scenes/world/effects/particles.ts @@ -1,4 +1,3 @@ -import { WORLD_DEPTH_EFFECT } from '~const/world'; import { Assets } from '~lib/assets'; import { IWorld } from '~type/world'; import { @@ -46,9 +45,7 @@ export class Particles implements IParticles { follow: dynamic ? parent : undefined, }, ); - this.emitter.setDepth( - position?.y ?? parent?.y ?? WORLD_DEPTH_EFFECT, - ); + this.emitter.setDepth(parent.depth + 1); this.destroy = this.destroy.bind(this); this.update = this.update.bind(this); @@ -73,6 +70,6 @@ export class Particles implements IParticles { } private update() { - this.emitter.setDepth(this.parent.depth); + this.emitter.setDepth(this.parent.depth + 1); } }