Feature: books start levitating

This commit is contained in:
Dejvino
2025-11-16 16:32:13 +01:00
parent 6e2a59ce77
commit 2e1e6bddfa
3 changed files with 73 additions and 0 deletions
+8
View File
@@ -102,8 +102,16 @@ export function createBookshelf(x, z, rotationY, uniqueSeed) {
book.castShadow = true;
book.receiveShadow = true;
// Store original Y position and animation data
book.userData.originalY = book.position.y;
book.userData.levitateOffset = 0;
book.userData.oscillationTime = Math.random() * Math.PI * 2; // Start at random phase
shelfGroup.add(book);
if (Math.random() > 0.8) {
state.books.push(book);
}
currentBookX += bookWidth + 0.002; // Tiny gap between books
if (seededRandom() > 0.92) {