Live data from Hacker News

HTML5 Snake

xarg.org

1–10 of 16 posts

Re: HTML5 Snake

#2
That's fun! It runs pretty fast, though. You might want to have it start a bit slower.

You should also use requestAnimationFrame instead of setInterval.

    http://paulirish.com/2011/requestanimationframe-for-smart-animating/

Re: HTML5 Snake

#3
post #2

That's fun! It runs pretty fast, though. You might want to have it start a bit slower. You should also use requestAnimationFrame instead of setInterval. http://paulirish.com/2011/requestanimationframe-for-smart-animating/

Might also be nice to have a 'Start Game' button--I clicked the link and then got a dialog about losing. Blocks on the edges are also a little hard to get at. Nice job! Fun too. :)

Re: HTML5 Snake

#5
Having never programmed a game, I would have expected a lot more… code. It's super inspiring to see how simple (and readable) it is.

Seems like an elegant implementation.

Re: HTML5 Snake

#8
post #2

That's fun! It runs pretty fast, though. You might want to have it start a bit slower. You should also use requestAnimationFrame instead of setInterval. http://paulirish.com/2011/requestanimationframe-for-smart-animating/

Might also be nice to have a 'Start Game' button--I clicked the link and then got a dialog about losing. Blocks on the edges are also a little hard to get at. Nice job! Fun too. :)

These are the two things I would suggest, too.

Re: HTML5 Snake

#10
Any reason for having javascript alerts? Instead of inside the game window?

BTW the javascript alert shows up on a different monitor in my dual-head setup.

Post reply on HN