TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

HTML5 Snake Game with source code walkthrough

59 点作者 jdstraughan大约 12 年前

7 条评论

kranner大约 12 年前
This is nice; I like how the background updates to show the level-state.<p>I recently started porting my native iOS game to HTML5. After Xcode/Objective-C, HTML5 development is just so refreshing for the 1) instant reload, 2) succinctness of Javascript. I'm kicking myself for not starting sooner.<p>Here's a link to my HTML5 game: <a href="http://noisytyping.com/NCT6745/index.html" rel="nofollow">http://noisytyping.com/NCT6745/index.html</a> (work in progress!)<p>edit: I just realized I haven't put in a tutorial yet. It's an Arukone implementation: connect all number-pairs, and fill the grid.
评论 #5331659 未加载
xiaoma大约 12 年前
I like it! I really relate to the childhood dream of making games. I've been dipping my toes HTML5 gamedev myself, but thus far have done everything with DOM nodes. Have you thought of putting it up on some app stores? Or at least the chrome store? That one is pretty easy and free. No clue how much traffic to expect from it, though.
andyn大约 12 年前
Maybe it's just me, but the requestAnimationFrame code fails in Firefox unless they're all prefixed with 'window.'<p>It probably works straight away in Chrome because requestAnimationFrame is defined.
评论 #5331209 未加载
abirb大约 12 年前
So Cool. Thanks for the detailed, specific &#38; well-designed contextual explanations!<p>I am honing my HTML5 skills, and this was very useful. I started playing with your code...
评论 #5331103 未加载
m4tthumphrey大约 12 年前
Screen moves with the snake. Chrome 25.0.1364.152.
评论 #5331076 未加载
mha_bd大约 12 年前
You have used path to draw the boxes instead of drawRect() function. Is there any particular reason/advantage behind that?
pav3l大约 12 年前
Funny how even after years of Vim-ing, using "hjkl" in a video game still trips me up.
评论 #5332070 未加载