[HN Gopher] Spherical Snake
___________________________________________________________________
Spherical Snake
Author : subset
Score : 302 points
Date : 2026-01-01 06:15 UTC (5 days ago)
(HTM) web link (kevinalbs.com)
(TXT) w3m dump (kevinalbs.com)
| plehoux wrote:
| I love this, congratulations on the clever design and concept.
| olivierestsage wrote:
| Extremely fun and satisfying, nice job
| rezmason wrote:
| Nicely done!
|
| Related projects:
|
| https://wakaba.c3.cx/s/games/swear
|
| https://milksnake.c3.cx
| DrPhish wrote:
| Also s4nake, the concept in a 4k binary from the demoscene
| circa 2013
|
| https://www.pouet.net/prod.php?which=61035
| painted-now wrote:
| Oh yeah! I was playing MacSwear quite a bit on my friends
| MacBook (I think with a PowerPC CPU)
| dherls wrote:
| Really impressive that it's implemented in < 400 lines of
| Javascript code and runs so smoothly in my phone's browser
| (Firefox on Android)
| g4zj wrote:
| This is really fun! Nice job.
|
| Small issue: I accidentally right-clicked one of the arrow
| buttons and it stuck in the pressed position, causing the snake
| to curl into itself and end my game before I could left-click out
| of the context menu.
| Ecco wrote:
| Really cool game, but please please fix the viewport to prevent
| accidentaly zooming on the page on a mobile device!
| xp84 wrote:
| And while you're at it fix it so you can't do a text selection
| of the game area. I'm having both zooming and selection
| happening and they make it unplayable.
| wanderingstan wrote:
| Yes. And it's so easy:
|
| `<meta name="viewport" content="width=device-width, initial-
| scale=1.0, maximum-scale=1.0, user-scalable=no">`
| arscan wrote:
| It has something like that already[1]. I'm curious what's
| wrong with that.
|
| 1. https://github.com/kevinAlbs/SphericalSnake/blob/b90773847
| 6d...
| argsnd wrote:
| Presumably it has to be "no" instead of "0"
| bArray wrote:
| Quite a good implementation, got to 62 and was playing a "space
| filling curve" strategy to bleed off some of the length. Looking
| at the leader-board I suspect some people are just sending off
| their own custom submissions [1].
|
| [1] https://kevinalbs.com/spherical_snake/leaderboard/
| tgtweak wrote:
| There is a maximum theoretical length and the sphere actually
| allows you to wrap around it, Rod of Asclepius style, until you
| get there - picking up an apple on each cycle. I suspect it's
| not more than a few hundred segments though so those ~600
| submissions are probably someone gaming the submission with a
| forged score.
| fusslo wrote:
| now there's 9999 and 1337 for scores. Imma guess there's not
| a lot of security on the scoreboard of a fun little game
| H3X_K1TT3N wrote:
| I cheated (for science)
| tigereyeTO wrote:
| So, Astro Bears without the bears?
| bogtog wrote:
| 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
| re wrote:
| 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);})()
| giarc wrote:
| Agree - my millennial brain got bored quickly and it was still
| very easy.
| progbits wrote:
| 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.
| elicash wrote:
| Speed should slightly increase with each new apple
| arthurcolle wrote:
| this could legit be pre-installed on a nokia phone in some
| alternate potential future!
|
| great work
| therobots927 wrote:
| Very cool but on iOS safari, if I click one of the buttons twice
| too quickly it zooms in and I can't see the full screen or the
| other button. Hard to zoom back out at least on my phone.
| dwa3592 wrote:
| very nice.
|
| maybe add a sound effect :)
| lovegrenoble wrote:
| Simple and fun!
| black_knight wrote:
| The original was toroidal!
| toroszo wrote:
| best snake experience since 3210
| neanderzander wrote:
| Cool. It would also be interesting to see a hyperbolic snake.
|
| Reminds me of this video, where the dev compares spherical and
| hyperbolical geometries (albeit a dimension higher):
|
| https://www.youtube.com/watch?v=yY9GAyJtuJ0
| myhf wrote:
| The Land of Eternal Motion in HyperRogue is an example of a
| hyperbolic snake game. You can continue moving indefinitely
| with an infinite tail.
|
| https://hyperrogue.miraheze.org/wiki/Land_of_Eternal_Motion
| tantalor wrote:
| Lovely. Would love if it canvas was bigger on desktop. Zoomed in
| 3x is much better but pix-elated. The first 50 or so levels were
| very easy. Started getting difficult around 90+.
| H3X_K1TT3N wrote:
| This should work: function scale(multi) { cnv =
| document.getElementsByTagName('canvas')[0]; cnv.width = 358 *
| multi; cnv.height = 360 * multi; window.focalLength = 200 *
| multi; window.init(); } scale(4);
| nickandbro wrote:
| Love it
| jp57 wrote:
| When the game ends, the banner obscures the exact spot where the
| snake ran into itself, which is the thing you most want to see at
| the end.
| pryelluw wrote:
| Maybe add a skin around the sphere to make it look like the
| earth. Then the targets become places.
| EricRiese wrote:
| I feel like this legitimately improves my intuition for
| Riemannian geometry.
| vlachen wrote:
| Bozhe moy! [1]
|
| [1] https://tomlehrersongs.com/lobachevsky/
| bardackx wrote:
| pretty boring start, quite fun once the snake is the size of the
| sphere circumference
| amadeoeoeo wrote:
| Love it! Would like to have the option to make the arrow buttons
| closer to play with one hand. Thank you!
| greenwallnorway wrote:
| People are having fun submitting their fake scores to the
| leaderboard: https://kevinalbs.com/spherical_snake/leaderboard/
|
| I see a person or two I know in there haha
| Aardwolf wrote:
| Obviously 666, 1337, 9223372036854775807 etc... in the
| leaderboard are fake, so if I had to try to figure out what the
| highest legit score is, I'd guess milkman with 227. Unless
| someone was clever enough to make an inconspicuous fake number :)
| byearthithatius wrote:
| kinda like that hacker news hacked it pretty quick haha
| JasonADrury wrote:
| Definitely a good concept, but the controls feel super janky. The
| early game is also a bit too slow.
| byearthithatius wrote:
| Is there a place I can read about taking unique creative
| approaches to original topics/games/concepts like this? "Thinking
| Different with Basics". I like this so much but its because it
| gets at an essence of creativity applied to the obvious I don't
| know how to learn or search for:(
| rustystump wrote:
| Sadly i dont know if this can be learned persay as it wobbles
| along the "creativity" line.
|
| Id say that youd need to have a genuine curiosity along with a
| "what if" mindset that is hard to teach. The path to these
| ideas is often a train of what ifs, what if snake was 3d? Then
| what if it was 3d on a planet? What about a cube?
|
| You can take the same thought to other games. What if pong was
| 3d or on a sphere? What if pong supported 100 people playing
| together? How would that work?
|
| Often what ifs will be deadends or uninteresting. It is like
| sales, a volume game. But u got to like the process or you wont
| get far.
| ocrow wrote:
| Yes! Curiosity is the way to open these doors. The first step
| is to keep a log of your thoughts. Anything that pops up,
| write it in your ideas book. Having ideas isn't an all or
| nothing. It's a practice. Get into the practice of writing
| down your small ideas and you will develop the ideas muscle.
| tuetuopay wrote:
| Snake was my very first OpenGL program (well, past a cube).
| You learn quite a bit about the basics and why one more
| dimension is not always better.
|
| Fun times, this takes me back quite a bit. Definitely from
| the "what if" mindset, I was seeking something complex enough
| for learning and simple enough to actually finish. I must
| have been 15 or 16 at the time.
| sumibi wrote:
| I made a multiplayer 3D pong in a cube years ago:
| https://cubeball.araxor.com/
|
| It was a VR game for google cardboard. It worked pretty well
| at the time.
|
| Sadly, it's not available anymore in the google play store.
| Maybe one day I'll port it to the web and open source it if I
| can find the time...
| zemo wrote:
| https://mitpress.mit.edu/9780262043915/elements-of-game-desi...
|
| https://theoryoffun.com/
|
| https://mitpress.mit.edu/9780262240451/rules-of-play/
|
| https://www.sciencedirect.com/book/monograph/9780123694966/t...
|
| https://en.wikipedia.org/wiki/Chris_Crawford_on_Game_Design
|
| https://en.wikipedia.org/wiki/Game_Design_Workshop
| wonger_ wrote:
| I watched this GDC talk recently about practical creativity:
| https://www.youtube.com/watch?v=zyVTxGpEO30
|
| I like his perspective that creativity = using an existing
| pattern in a new context.
|
| You can be more creative by first consuming lots of different
| patterns in all sorts of contexts (e.g. playing lots of games,
| and also reading and experiencing lots of topics unrelated to
| games).
|
| Then you try all the different permutations of patterns in your
| mental toolbox. Kinda like how the sibling comment rattled off
| different what-ifs.
|
| EDIT oh and oblique strategies might be helpful to come up with
| variations on an existing theme:
| https://stoney.sb.org/eno/oblique.html
| nicoboo wrote:
| Good game concept and implementation. Run smoothly even on phone.
|
| Extend the capability to include timer, boost of speed and even
| levels with enemies.. I would love to also try having a kind of
| multi level support for moves.. Like 3 layers to explore the 3d
| navigation with layers of ground for moves.
|
| Awesome experiments that could easily become viral! :)
| rationalist wrote:
| Tried submitting my score, but it said the captcha score was too
| low?
| gapeslape wrote:
| This reminds me of an idea I had a few days ago. Imagine a world
| where speed of light:
|
| - is small compared to human level speeds (say 2km/h / 1.25mph)
|
| - things could move faster than the speed of light.
|
| I really wonder how it would feel to explore this world visually.
| For example:
|
| - an object in front of me accelerates from 0 to above the speed
| of light
|
| - I'm in a car, looking backwards, going from 0 to above the
| speed of light
|
| I guess one could easily simulate that in a virtual world, no?
| naftalibeder wrote:
| Enjoy :)
|
| https://gamelab.mit.edu/games/a-slower-speed-of-light/
| gapeslape wrote:
| This is awesome, thanks!
|
| I wonder if you could make it multiplayer and then get the
| effects of time dilation?
|
| In my imagined world I also wanted to explore speeds above
| the speed of light. You could just stick to galilean
| transformation, take a very low speed of light and go from
| there. The world you get should be pretty bizarre.
| prolyxis wrote:
| I suppose the problem in multiplayer is that everyone has
| the same wall clock time, so you couldn't easily have
| consistent time dilation and related effects such as the
| twin paradox.
| amichail wrote:
| For a new kind of snake game, check out PluriSnake.
|
| PluriSnake is a snake-based color matching daily puzzle game.
|
| Color matching is used in two ways: (1) matching circles creates
| snakes, and (2) matching a snake's color with the squares beneath
| it destroys them.
|
| Snakes, but not individual circles, can be moved by snaking to
| squares of matching color, as long as their paths are not blocked
| by other snakes.
|
| The goal is to score as highly as you can. Destroying all the
| squares is not required for your score to count.
|
| Of course, there is more to it than that as you will see.
|
| Try it out:
|
| https://testflight.apple.com/join/mJXdJavG
|
| Any feedback would be appreciated. Have fun!
| shermantanktop wrote:
| I tried it, but really shouldn't have as I am colorblind and so
| matches were quite difficult. Some color games have an option
| for a colorblind-safe palette, maybe consider that?
| RIMR wrote:
| This version feels easier until suddenly it very much isn't!
| baq wrote:
| For a multiplayer spherical tron-like experience check out Astro
| Bears, it's a great little party game!
| rustystump wrote:
| Nit: when on mobile pressing and holding highlights the elements
| as if they were text.
|
| You can fix that with a simple css prop.
|
| Very cool btw
| darkvertex wrote:
| Fun take! Would love to just drag my finger on the sphere to
| affect the direction instead of the two big buttons.
| FpUser wrote:
| This thing is addictive. The last time I played snake was on
| Apple-II computer hooked up to some scientific equipment back in
| USSR
| aaroninsf wrote:
| Opportunity for v1.1:
|
| as things get more difficult it becomes increasingly important to
| control space-use and the resultant territory occupied by the
| snek; at a certain point I switched priorities from "get the
| target as quickly as possible" to "maintain a regular controlled
| movement"
|
| Something that leapt out at this point was, there is no tension
| or penalty for doing so.
|
| Opportunity to increase game challenge/skill requirement:
| introduce an incentive to get the target as quickly as possible.
|
| One interesting way to do this would be to make the ball get
| bigger over time, with bigger balls adding more segments to the
| snek.
|
| I like this sort of approach because it leaves supports two
| distinct play styles/cases:
|
| - some players would see this as incentive to get to the target
| ASAP, to avoid growing more than necessary, thus prolonging their
| survival at the same difficulty
|
| - others would see an incentive to let avoid the target,
| especially if it grows non-linearly, so as to jump to increased
| difficulty ASAP
| nomel wrote:
| Very neat. Would be cool to see in 3d (cross eye option [1]!? :D)
|
| I think an accelerated initial growth is needed. Maybe start with
| a growth of 5 and have it decrease so it's a 1 at around 50. It
| takes a bit too long to get to something non trivial, especially
| since it seems there is a bias to put dots on the opposite side,
| causing the first 5 minutes to be mostly going in a straight
| circumnavigations.
|
| [1] https://www.kula3d.com/how-to-use-the-cross-eyed-method
| danielheath wrote:
| A fun alternative to "Snake on a Plane"
| tptacek wrote:
| It should start at score 50, which is when the game actually gets
| interesting.
| shomp wrote:
| Just need to reach MAX_SAFE_INT and I too can be on the
| leaderboard... And I thought 78 was pretty good
| mxfh wrote:
| Beyond 100 it becomes a game of avoiding the _The Loxodrome of
| Terror_ by spiralling into an unescapeable trap.
|
| Easiest pattern to get some more length is to do some sort of
| spherical sinusoid by following the meridian and then some
| optional final fill loop for the poles.
|
| Overall it feels a bit slow to get to the part where it becomes
| tricky
|
| For optimal fill you might end up with something like a tennis
| ball/baseball pattern instead.
|
| see fig 5 here
|
| https://arxiv.org/abs/1005.4609
| gaigalas wrote:
| I clicked expecting a philosophical contrast to the idea of
| spherical cows.
|
| Nice game though!
| jm_l wrote:
| I noticed that the dots on the surface of the sphere are evenly
| spaced out close to the equator, but because there is a
| consistent number of dots in each ring, they are very close
| together when you reach the poles.
|
| One way to get dots evenly spread out over the surface of a
| sphere is to use a phyllotaxis spiral pattern.
|
| https://demonstrations.wolfram.com/PhyllotaxisSpiralPatternO...
| omoikane wrote:
| I wish there is a mode where the snake go toward where my mouse
| cursor is (similar to agar.io), as opposed to having the controls
| turn the snake. So in update function where we have the
| "direction-=.08" and "direction+=.08" bits, "direction" would be
| assigned a value either due to the pressed state of the 4 arrow
| keys, or some arctangent of mouse coordinates:
|
| https://github.com/kevinAlbs/SphericalSnake/blob/b907738476d...
|
| Alternatively, keep the current controls, but rotate the whole
| world to match the snake's direction of movement. Current mix of
| non-rotating world with rotating controls makes the game more
| difficult, most snake variants I have played opted for non-
| rotating world with non-rotating controls (e.g. press right to go
| right, independent of current snake heading, as opposed to
| turning clockwise).
| matoseb wrote:
| Reminds me of a old iPhone game "Snake Galaxy" with the same
| principle https://www.youtube.com/watch?v=8LEIC_BOhgE
___________________________________________________________________
(page generated 2026-01-06 23:01 UTC)