gl and clicking fiexs
This commit is contained in:
parent
2c842d5b0f
commit
588f5c09d8
2 changed files with 7 additions and 3 deletions
|
@ -106,7 +106,7 @@ function renderThing() {
|
|||
hud.textContent = `${Math.floor(nothingness * 100) / 100} nothings; ${Math.floor(nGain * 60 * 100) / 100} nil/sec`
|
||||
|
||||
gl.uniform1f(sizeBuffer, -Math.log(nothingness));
|
||||
gl.uniform1f(distBuffer, 0.1 + nGain / (nothingness+10));
|
||||
gl.uniform1f(distBuffer, 0.1 + 3 * nGain/(nGain+1));
|
||||
|
||||
var primitiveType = gl.TRIANGLES;
|
||||
var offset = 0;
|
||||
|
@ -121,6 +121,11 @@ requestAnimationFrame(renderThing)
|
|||
|
||||
let clicking = false;
|
||||
|
||||
setInterval(function() {
|
||||
|
||||
nothingness += nGain;
|
||||
},1000 / 60)
|
||||
|
||||
document.body.onclick = async function() {
|
||||
if (clicking) return;
|
||||
clicking = true;
|
||||
|
@ -128,7 +133,6 @@ document.body.onclick = async function() {
|
|||
nGain += 0.05;
|
||||
while (nGain > oldNGain) {
|
||||
nGain -= 0.005;
|
||||
nothingness += nGain;
|
||||
await new Promise((res) => setTimeout(res,1000 / 60))
|
||||
}
|
||||
nGain = oldNGain;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue