Skip to content

Instantly share code, notes, and snippets.

@wcjohnson11
Created February 23, 2022 03:29
Show Gist options
  • Save wcjohnson11/76f2e2af8a2f09c7162269fb76d6c5f4 to your computer and use it in GitHub Desktop.
Save wcjohnson11/76f2e2af8a2f09c7162269fb76d6c5f4 to your computer and use it in GitHub Desktop.
terraforms animation logic
setInterval(()=>{
for(let e=0; e<32;e++)
for(let t=0;t<32;t++){
let r=gridEls[t+32*e];
// If its a terrain
0==MODE?
r.h>6-RESOURCE && (r.textContent=mainSet[Math.floor(.25*airship (r.h+.5*e+.1*DIRECTION*t))%mainSet.length]) :
// If it's daydreamed or terraformed
(isDaydream||isTerraformed) &&
(0==r.h ?
SEED<8e3 ?
r.textContent=mainSet[Math.floor(airship/1e3+.05*e+.005*t)%mainSet.length] :
r.textContent=mainSet[Math.floor(airship/2+.05*e)%mainSet.length] :
(r.textContent=charSet[Math.floor(airship/speedFac+e+r.h)%charSet.length],SEED>5e3 &&
Math.random()<.005&&(r.style.fontSize=`${3+airship%34}px`))
),'j'!=r.originalClass &&
'j'!=r.activeClass||(r.textContent=' ')
}
airship =1
// loopLength for interval
},loopLength),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment