Feature: Music playback

This commit is contained in:
Dejvino
2025-11-23 20:33:32 +01:00
parent 141b3acf72
commit 451d4ea261
14 changed files with 255 additions and 54 deletions
@@ -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));
}
}
+6 -6
View File
@@ -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;
}