def update(self): ParticleGroup.update(self) if engine.clock.time - self.lastSpawn >= self.lifeTime: self.delete() if self.active and ParticleGroup.begun: if engine.clock.time - self.lastPositionUpdate < 0.1: if self.lastPosition != None: vector = self.position - self.lastPosition distance = vector.length() if distance > 0: vector /= distance for f in engine.frange(0.0, distance, self.interval): self.spawnParticle(self.position + (vector * f)) else: self.spawnParticle(self.position)
def update(self): ParticleGroup.update(self) if self.isIndependent and engine.clock.time - self.lastSpawn >= self.lifeTime: self.delete() if self.active and ParticleGroup.begun: if engine.clock.time - self.lastPositionUpdate < 0.1 and engine.clock.time - self.lastSpawn > 0.01: if self.lastPosition != None: vector = self.position - self.lastPosition distance = vector.length() if distance > 0 and distance < 4.0: vector /= distance points = engine.frange(0.0, distance, self.interval) for f in points: self.spawnParticle(self.position + (vector * f) + (Vec3(uniform(-1.0, 1.0), uniform(-1.0, 1.0), uniform(-1.0, 1.0)) * 0.5)) else: self.spawnParticle(self.position + Vec3(uniform(-1.0, 1.0), uniform(-1.0, 1.0), 0) * 0.5)
def update(self): ParticleGroup.update(self) if self.isIndependent and engine.clock.time - self.lastSpawn >= self.lifeTime: self.delete() if self.active and ParticleGroup.begun: if engine.clock.time - self.lastPositionUpdate < 0.1 and engine.clock.time - self.lastSpawn > 0.01: if self.lastPosition != None: vector = self.position - self.lastPosition distance = vector.length() if distance > 0 and distance < 4.0: vector /= distance points = engine.frange(0.0, distance, self.interval) for f in points: self.spawnParticle(self.position + (vector * f) + ( Vec3(uniform(-1.0, 1.0), uniform(-1.0, 1.0), uniform(-1.0, 1.0)) * 0.5)) else: self.spawnParticle( self.position + Vec3(uniform(-1.0, 1.0), uniform(-1.0, 1.0), 0) * 0.5)