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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Show HN: HTML5 Ping-Pong Game

25 点作者 luzon19将近 13 年前

4 条评论

sopooneo将近 13 年前
That is cool. I love the touch of the little dust explosions off the paddles. For anyone else that wants to start playing with canvas, let me relate a gotcha that drove me absolutely nuts. And if I'm mistaken on this, someone please set me straight.<p>The issue: You can <i>not</i> paint pixels directly onto a canvas. Instead you create a buffer of specified dimensions, indicate what colors to make its pixels, then overlay that buffer onto the canvas at a specified location. So it is possible to wrap that functionality up into an api that lets you simulate direct pixel painting, but it is not possible with raw javascript. Lines and other shapes, on the other hand, can be rasterized directly onto the canvas.
评论 #4224504 未加载
freehunter将近 13 年前
Are there any good tools/frameworks for HTML5 games yet? Every time I see a rundown of how a developer made an HTML5/JS game, the common complaint from that dev is that the tools are far from mature and they had to recreate X and Y by hand.
davidstith将近 13 年前
Nice job! I was looking for something like this for a project I'm working on. Just FYI - If I resize the window to the width of the paddles I can play forever :) <a href="http://imgur.com/ukxi8" rel="nofollow">http://imgur.com/ukxi8</a>
mukundmohan将近 13 年前
Very nice. I like it.