akhaliq HF staff commited on
Commit
4851b06
·
verified ·
1 Parent(s): b74dce0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -104,6 +104,9 @@ with demo:
104
  face.lane = 0; // -1, 0, 1
105
  face.jumping = false;
106
 
 
 
 
107
  // Collectibles
108
  const gpuCanvas = document.createElement('canvas');
109
  gpuCanvas.width = 128;
@@ -191,6 +194,7 @@ with demo:
191
  face.velocity.set(0, 0, -12);
192
  face.lane = 0;
193
  face.jumping = false;
 
194
  gpuScore = 0;
195
  gpuCounter.textContent = `Score: ${gpuScore}`;
196
  gpuSprites.forEach(gpu => scene.remove(gpu));
 
104
  face.lane = 0; // -1, 0, 1
105
  face.jumping = false;
106
 
107
+ // Ensure initial rotation faces the user
108
+ face.rotation.y = Math.PI; // Rotate 180 degrees to face backward initially
109
+
110
  // Collectibles
111
  const gpuCanvas = document.createElement('canvas');
112
  gpuCanvas.width = 128;
 
194
  face.velocity.set(0, 0, -12);
195
  face.lane = 0;
196
  face.jumping = false;
197
+ face.rotation.y = Math.PI; // Reset rotation to face user
198
  gpuScore = 0;
199
  gpuCounter.textContent = `Score: ${gpuScore}`;
200
  gpuSprites.forEach(gpu => scene.remove(gpu));