Feature: Music playback
This commit is contained in:
@@ -16,7 +16,7 @@ export class EffectsManager {
|
||||
this.effects.push(effect);
|
||||
}
|
||||
|
||||
update() {
|
||||
this.effects.forEach(effect => effect.update());
|
||||
update(deltaTime) {
|
||||
this.effects.forEach(effect => effect.update(deltaTime));
|
||||
}
|
||||
}
|
||||
@@ -7,15 +7,15 @@ export class DustEffect {
|
||||
}
|
||||
|
||||
_create(scene) {
|
||||
const particleCount = 2000;
|
||||
const particleCount = 3000;
|
||||
const particlesGeometry = new THREE.BufferGeometry();
|
||||
const positions = [];
|
||||
|
||||
for (let i = 0; i < particleCount; i++) {
|
||||
positions.push(
|
||||
(Math.random() - 0.5) * 15,
|
||||
Math.random() * 10,
|
||||
(Math.random() - 0.5) * 15
|
||||
Math.random() * 8,
|
||||
(Math.random() - 0.5) * 45
|
||||
);
|
||||
}
|
||||
particlesGeometry.setAttribute('position', new THREE.Float32BufferAttribute(positions, 3));
|
||||
@@ -32,11 +32,11 @@ export class DustEffect {
|
||||
scene.add(this.dust);
|
||||
}
|
||||
|
||||
update() {
|
||||
if (this.dust) {
|
||||
update(deltaTime) {
|
||||
if (deltaTime && this.dust) {
|
||||
const positions = this.dust.geometry.attributes.position.array;
|
||||
for (let i = 1; i < positions.length; i += 3) {
|
||||
positions[i] -= 0.001;
|
||||
positions[i] -= deltaTime * 0.006;
|
||||
if (positions[i] < -2) {
|
||||
positions[i] = 8;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user