diff options
Diffstat (limited to 'src/entities/borderParticles.js')
-rw-r--r-- | src/entities/borderParticles.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/entities/borderParticles.js b/src/entities/borderParticles.js index a8d7036..34512bc 100644 --- a/src/entities/borderParticles.js +++ b/src/entities/borderParticles.js @@ -31,9 +31,7 @@ game.createBorderParticles = ({colors, maxAmount, minAmount, minLife, maxLife, m } return particle; }); - particles.addComponent(game.components.LoadPriority({priority: 1})); - particles.addComponent(game.components.Alive()); - particles.sprite = game.graphics.Sprite({ + game.sprites.borderParticle = game.graphics.Sprite({ drawFunction: (elapsedTime, {x, y, width, height}, context) => { particleSpecs.map((spec) => spec.elapsed += elapsedTime); particleSpecs = particleSpecs.filter((spec) => spec.lifetime > spec.elapsed); @@ -51,5 +49,8 @@ game.createBorderParticles = ({colors, maxAmount, minAmount, minLife, maxLife, m }); } }) + particles.addComponent(game.components.LoadPriority({priority: 1})); + particles.addComponent(game.components.Alive()); + particles.addComponent(game.components.Sprite({spriteName: "borderParticle"})) return particles; }
\ No newline at end of file |