Spaces:
Running
Running
cutechicken
commited on
Commit
β’
10f6358
1
Parent(s):
e52c580
Update game.js
Browse files
game.js
CHANGED
@@ -847,6 +847,13 @@ class Particle {
|
|
847 |
// Game ν΄λμ€
|
848 |
class Game {
|
849 |
constructor() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
850 |
// κ²μ μμ μ¬λΆλ₯Ό μΆμ νλ νλκ·Έ μΆκ°
|
851 |
this.isStarted = false;
|
852 |
// μ€λμ€ κ΄λ ¨ μμ± μΆκ°
|
@@ -1801,6 +1808,9 @@ class Game {
|
|
1801 |
}
|
1802 |
return;
|
1803 |
}
|
|
|
|
|
|
|
1804 |
|
1805 |
this.animationFrameId = requestAnimationFrame(() => this.animate());
|
1806 |
// κ²μμ΄ μμλμ§ μμμΌλ©΄ λ λλ§λ§ μν
|
@@ -1833,6 +1843,7 @@ class Game {
|
|
1833 |
}
|
1834 |
|
1835 |
this.renderer.render(this.scene, this.camera);
|
|
|
1836 |
}
|
1837 |
}
|
1838 |
|
|
|
847 |
// Game ν΄λμ€
|
848 |
class Game {
|
849 |
constructor() {
|
850 |
+
// Stats μ΄κΈ°ν μΆκ°
|
851 |
+
this.stats = new Stats();
|
852 |
+
this.stats.showPanel(0); // 0: fps, 1: ms, 2: mb, 3+: custom
|
853 |
+
this.stats.dom.style.position = 'absolute';
|
854 |
+
this.stats.dom.style.left = '0px';
|
855 |
+
this.stats.dom.style.top = '0px';
|
856 |
+
document.body.appendChild(this.stats.dom);
|
857 |
// κ²μ μμ μ¬λΆλ₯Ό μΆμ νλ νλκ·Έ μΆκ°
|
858 |
this.isStarted = false;
|
859 |
// μ€λμ€ κ΄λ ¨ μμ± μΆκ°
|
|
|
1808 |
}
|
1809 |
return;
|
1810 |
}
|
1811 |
+
this.stats.begin();
|
1812 |
+
|
1813 |
+
this.animationFrameId = requestAnimationFrame(() => this.animate())
|
1814 |
|
1815 |
this.animationFrameId = requestAnimationFrame(() => this.animate());
|
1816 |
// κ²μμ΄ μμλμ§ μμμΌλ©΄ λ λλ§λ§ μν
|
|
|
1843 |
}
|
1844 |
|
1845 |
this.renderer.render(this.scene, this.camera);
|
1846 |
+
this.stats.end();
|
1847 |
}
|
1848 |
}
|
1849 |
|