import { Particle } from './Types'; /** A particle system which contains particles that update themselves */ export default class ParticleSystem { readonly PARTICLE_POOL_SIZE = 2000; readonly PARTICLE_LIFETIME = 40; private width; private height; private oldestParticle; private lastUpdate; readonly particles: readonly Readonly[]; /** * @param width - Height of the particle system, typically in pixels * @param height - Width of the particle system, typically in pixels */ constructor(width: number, height: number); /** * Update the size of the particle system. * @param newWidth - New width in pixels * @param newHeight - New height in pixels */ setSize(newWidth: number, newHeight: number): void; /** * Updates all particle positions based on their current position, * velocity, and the amount of time that's passed. */ update(): void; /** * Creates a new particle * @param x - Particle's x position, in pixels * @param y - Particle's y position, in pixels * @param vx - Particle's x velocity, in pixels per 1/60th of a second * @param vy - Particle's y velocity, in pixels per 1/60th of a second */ createParticle(x: number, y: number, vx: number, vy: number): void; /** * Creates a burst of particles exploding out in a circle from a single point * @param x - The x coordinate of the emanation point * @param y - The y coordinate of the emanation point * @param v - The velocity of the particles, in pixels per 1/60th of a second * @param n - The number of particles to create */ createParticleBurst(x: number, y: number, v: number, n: number): void; }