Implement DAS/ARR for smooth horizontal piece movement

This commit is contained in:
2026-03-24 17:59:55 -07:00
parent 36965dc887
commit 3a307dbc80
11 changed files with 338 additions and 26 deletions
+34
View File
@@ -0,0 +1,34 @@
// Audio Manager - Handles background music only
class AudioManager {
constructor() {
this.bgMusic = document.getElementById('bg-music');
if (this.bgMusic) {
this.bgMusic.volume = 0.5;
}
}
playLobby() {
// No lobby music
}
playGame() {
if (!this.bgMusic) return;
this.bgMusic.src = '/audio/tetris_theme_og.mp3';
this.bgMusic.loop = true;
this.bgMusic.play().catch(e => console.log('Audio autoplay blocked:', e));
}
playGameOver() {
// No game over music
}
stop() {
if (!this.bgMusic) return;
this.bgMusic.pause();
this.bgMusic.currentTime = 0;
}
}
// Initialize audio manager
const audio = new AudioManager();