Compare commits

...

2 Commits

Author SHA1 Message Date
825fbca97b fix a leak 2024-09-26 23:15:15 +02:00
ce94604fc0 split fps & dev 2024-09-26 23:15:08 +02:00
2 changed files with 10 additions and 8 deletions

View File

@ -157,17 +157,19 @@ export class TetraGUI extends GUI {
changeMaterial(this.materialType) changeMaterial(this.materialType)
material.close() material.close()
controls.addEventListener("change", () => cameraPosition.controllersRecursive().forEach((control) => {
control.updateDisplay()
}))
}
if (window.location.search.includes("fps")) {
let fps = new FPS.default() let fps = new FPS.default()
document.body.appendChild(fps.dom) document.body.appendChild(fps.dom)
this.update = function() { this.update = function() {
fps.update() fps.update()
} }
controls.addEventListener("change", () => cameraPosition.controllersRecursive().forEach((control) => {
control.updateDisplay()
}))
} }
} }

View File

@ -200,9 +200,9 @@ class Mino extends THREE.Object3D {
this.rotateOnWorldAxis(this.rotationAngle, delta * this.angularVelocity) this.rotateOnWorldAxis(this.rotationAngle, delta * this.angularVelocity)
if (Math.sqrt(this.position.x * this.position.x + this.position.z * this.position.z) > 40 || this.position.y < -50) { if (Math.sqrt(this.position.x * this.position.x + this.position.z * this.position.z) > 40 || this.position.y < -50) {
this.dispose() this.dispose()
return false
} else {
return true return true
} else {
return false
} }
} }
@ -569,7 +569,7 @@ class Playfield extends THREE.Group {
updateFreedMinoes(delta) { updateFreedMinoes(delta) {
this.freedMinoes.forEach(mino => { this.freedMinoes.forEach(mino => {
if (mino.explode(delta)) this.freedMinoes.delete(this) if (mino.explode(delta)) this.freedMinoes.delete(mino)
}) })
} }