Hacker News new | ask | show | jobs
by bogtog 169 days ago
The game looks really good, although I think it'd be improved if the sphere was a bit smaller. It feels like it takes too long for the game to become difficult
3 comments

Here's a console command you can run to increase the snake length immediately, and thus the difficulty:

   (() => { let count = 50; const delay = 100; const interval = setInterval(() => { addSnakeNode(); if (--count <= 0) clearInterval(interval); }, delay);})()
Why wrap in a lambda?
Because I learned JS before ECMAScript 6 was widely supported by browsers and haven't written a ton of it targeting modern browsers. You're right that it's unnecessary.
Could be to allow use of local variables that do not leak into the scope this code is executed in. That's what I use this pattern for.
pro tip: no longer necessary

    { let count = 50; const interval = setInterval(() => { addSnakeNode(); if (--count <= 0) clearInterval(interval); }, 100) }
And polluting the global variable namespace hardly matters when using the console.
Speed should slightly increase with each new apple
I strongly disagree, I like that the challenge comes from the snake getting longer as opposed to speed.
Agree - my millennial brain got bored quickly and it was still very easy.
Easy up to ~70, interesting between 80-110, very hard around 120-130. I think scores above 200 are pretty sus, there is very little room on the sphere at that point (using the cheat from sibling comment). Anything >400 is definitely made up.