summaryrefslogtreecommitdiff
path: root/src/engine/entities/Particles.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/entities/Particles.ts')
-rw-r--r--src/engine/entities/Particles.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/engine/entities/Particles.ts b/src/engine/entities/Particles.ts
index 34b475c..5381b23 100644
--- a/src/engine/entities/Particles.ts
+++ b/src/engine/entities/Particles.ts
@@ -156,8 +156,12 @@ export class Particles extends Entity {
Math.floor(Math.random() * options.particleColors.length)
];
const position = {
- x: options.center.x + Math.cos(angle) * options.spawnerDimensions.width,
- y: options.center.y + Math.sin(angle) * options.spawnerDimensions.height,
+ x:
+ options.center.x +
+ (Math.cos(angle) * options.spawnerDimensions.width) / 2,
+ y:
+ options.center.y +
+ (Math.sin(angle) * options.spawnerDimensions.height) / 2,
};
if (options.spawnerShape === "rectangle") {
// determine a random position on the edge of the spawner based on the angle