Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -95,8 +95,7 @@ with demo:
|
|
95 |
emojiCtx.textBaseline = 'middle';
|
96 |
emojiCtx.fillText('🤗', 128, 128);
|
97 |
const emojiTexture = new THREE.CanvasTexture(emojiCanvas);
|
98 |
-
|
99 |
-
emojiTexture.flipY = false; // Explicitly set to false to maintain correct orientation
|
100 |
|
101 |
const faceGeometry = new THREE.SphereGeometry(0.8, 32, 32);
|
102 |
const faceMaterial = new THREE.MeshLambertMaterial({ map: emojiTexture });
|
@@ -143,15 +142,6 @@ with demo:
|
|
143 |
bgSound.play(); // Attempt to play immediately
|
144 |
});
|
145 |
|
146 |
-
// Collect sound
|
147 |
-
const collectSound = new THREE.PositionalAudio(listener);
|
148 |
-
face.add(collectSound);
|
149 |
-
audioLoader.load('https://threejs.org/examples/sounds/376737_Skullbeatz___Bad_Cat_Maste.mp3', function(buffer) {
|
150 |
-
collectSound.setBuffer(buffer);
|
151 |
-
collectSound.setRefDistance(10);
|
152 |
-
collectSound.setVolume(0.5);
|
153 |
-
});
|
154 |
-
|
155 |
// Game state
|
156 |
const clock = new THREE.Clock();
|
157 |
const gpuCounter = document.getElementById('gpu-counter');
|
@@ -262,7 +252,6 @@ with demo:
|
|
262 |
gpuSprites.splice(index, 1);
|
263 |
gpuScore++;
|
264 |
gpuCounter.textContent = `Score: ${gpuScore}`;
|
265 |
-
collectSound.play();
|
266 |
}
|
267 |
if (gpu.position.z > face.position.z + 10) {
|
268 |
scene.remove(gpu);
|
|
|
95 |
emojiCtx.textBaseline = 'middle';
|
96 |
emojiCtx.fillText('🤗', 128, 128);
|
97 |
const emojiTexture = new THREE.CanvasTexture(emojiCanvas);
|
98 |
+
emojiTexture.flipY = false; // Ensure correct orientation
|
|
|
99 |
|
100 |
const faceGeometry = new THREE.SphereGeometry(0.8, 32, 32);
|
101 |
const faceMaterial = new THREE.MeshLambertMaterial({ map: emojiTexture });
|
|
|
142 |
bgSound.play(); // Attempt to play immediately
|
143 |
});
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
// Game state
|
146 |
const clock = new THREE.Clock();
|
147 |
const gpuCounter = document.getElementById('gpu-counter');
|
|
|
252 |
gpuSprites.splice(index, 1);
|
253 |
gpuScore++;
|
254 |
gpuCounter.textContent = `Score: ${gpuScore}`;
|
|
|
255 |
}
|
256 |
if (gpu.position.z > face.position.z + 10) {
|
257 |
scene.remove(gpu);
|