Skip to content

Commit

Permalink
Fixed effects
Browse files Browse the repository at this point in the history
  • Loading branch information
neki-dev committed Nov 3, 2023
1 parent b9e714f commit cf34e4d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/game/scenes/world/effects/particles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { WORLD_DEPTH_EFFECT } from '~const/world';
import { Assets } from '~lib/assets';
import { IWorld } from '~type/world';
import {
Expand Down Expand Up @@ -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);
Expand All @@ -73,6 +70,6 @@ export class Particles implements IParticles {
}

private update() {
this.emitter.setDepth(this.parent.depth);
this.emitter.setDepth(this.parent.depth + 1);
}
}

0 comments on commit cf34e4d

Please sign in to comment.