Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Snake Game using jQuery (webdeveloperjuice.com)
19 points by John-Lee on April 9, 2014 | hide | past | favorite | 8 comments


There is a bug. If you are traveling right, then quickly press down, release down, then press left, and release left, you will die. This is not snake behavior.


I experienced the same bug. It makes quickly turning to get a 'food' block in an adjacent cell very difficult.


Yeah I think it misses some moves based on the timing loop


Why is this interesting? Is there some novel technique used here? The quality of the site its hosted on certainly isn't great.


I found it interesting that it works at all given that it's using td elements as board cells, jQuery to compare dom elements for cell referencing/dereferencing, and setInterval to update the animation and gamer input.


I had a bash a while back at getting a snake game to play how I wanted:

http://waynecrouch.co.uk/jsnake/ (source: https://github.com/wgcrouch/jSnake)


I also had some fun building a version of the snake game in JS some time ago http://komrade.github.io/snake/index.html


i thought it was going to be in under 30 lines




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: