From e6e29440563e33bb67e0ad51f9fb6c5c2c3fe809 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Thu, 7 Mar 2024 20:45:47 -0700 Subject: level one (applications prototype finished!) --- src/engine/entities/Particles.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/engine/entities/Particles.ts') 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 -- cgit v1.2.3-70-g09d2