From 25ebe3deb38d0f644efb9f56748dcf177618b421 Mon Sep 17 00:00:00 2001 From: biglyderv Date: Thu, 6 Mar 2025 21:31:44 -0500 Subject: [PATCH] balancing, visuals, clicking,s tuff --- docs/index.html | 2 +- docs/js/idle.js | 30 +++++++++++------------------- docs/js/index.js | 4 +++- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/docs/index.html b/docs/index.html index 60c32aa..3a9e914 100644 --- a/docs/index.html +++ b/docs/index.html @@ -36,7 +36,7 @@ // gl_FragColor is a special variable a fragment shader // is responsible for setting if (is_fg) { - gl_FragColor = vec4(b_position.xyz*0.1,1) * 0.2 + vec4(0.3,0.3,0.3,1) * 0.8; + gl_FragColor = vec4(b_position.xyz,1) * 0.2 + vec4(0.3,0.3,0.3,1) * 0.8; return; } float dist = (log(distance(b_position.xy,vec2(0.0))) - size_thing) / log(2.0) * 0.1; diff --git a/docs/js/idle.js b/docs/js/idle.js index 08b9721..48c1953 100644 --- a/docs/js/idle.js +++ b/docs/js/idle.js @@ -35,33 +35,25 @@ document.querySelector('canvas').addEventListener('click', (e) => { setInterval(function () { nothingness += nGain + getBonus; - getBonus += 0.0001 * cubePos.length; + nGain = 0.003 + 0.003 * cubePos.length; getBonus *= 0.93; for (let a of cubePos) { - let f = (nGain + getBonus * 100 + 10) / (nothingness + 10); + let f = (nGain + getBonus * 1000 + 10) / (nothingness + 10); + console.log(f,getBonus) - f *= 50; + let dist = Math.sqrt(a[0] ** 2 + a[1] ** 2) + dist = (f*90 / dist) ** 0.1; - if (f > 100) f = 100; + a[3] = a[3] * 0.9 + a[0] * (dist - 1); + a[4] = a[4] * 0.9 + a[1] * (dist - 1); - a[0] = a[0] * 0.9 + a[3] * .4 * f; - a[1] = a[1] * 0.9 + a[4] * .4 * f; + a[0] += a[3] * 0.01; + a[1] += a[4] * 0.01; - f /= Math.sqrt(a[0] * a[0] + a[1] * a[1]) / 0.3; + a[3] += Math.sin(f*0.1) * a[1]; - if (f > 0.3) f = 0.3; - - let a3 = a[3], a4 = a[4]; - - a[3] = Math.sin(f) * a4 + Math.cos(f) * a3; - - a[4] = -Math.sin(f) * a3 + Math.cos(f) * a4; - - let d = Math.sqrt(a[3] * a[3] + a[4] * a[4]) - - a[3] /= d / 2; - a[4] /= d / 2; + a[4] += -Math.sin(f*0.1) * a[0]; } }, 1000 / 60) diff --git a/docs/js/index.js b/docs/js/index.js index c568207..4774bb7 100644 --- a/docs/js/index.js +++ b/docs/js/index.js @@ -130,12 +130,14 @@ function renderThing() { let sizes = (nGain + 1) / (nothingness + 1) * 1000000 / (cubePos.length + 30); sizes = Math.pow(sizes, 0.3); if (sizes > 10) sizes = 10; + if (sizes < 3) sizes = 3; - positions = MDN.createCubeData(sizes, sizes, sizes); + positions = MDN.createCubeData(1,1,1); gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW); for (let cubie of cubePos) { let vp = MDN.rotateYMatrix(Math.log(nothingness + 1) * cubie[2] / 10); + vp = MDN.multiplyMatrices(MDN.scaleMatrix(sizes,sizes,sizes), vp) vp = MDN.multiplyMatrices(MDN.translateMatrix(cubie[0], cubie[1], cubie[2]), vp) gl.uniformMatrix4fv(vpBuffer, false, new Float32Array(vp));