James Williams
LinkedInMastodonGithub

HTML5 Game Programming FAQ Day 1

Tags: HTML5 Gaming

This week I'm answering questions about HTML5 and Game Programming in general over at CodeRanch. Here are a couple of the questions I answered today. Questions may have been tweaked for brevity.

Q: What I use for animation, setTimeout or requestAnimationFrame?

A: Use requestAnimationFrame. Check out Paul Irish 's requestAnimationFrame shim for an easy way to address all the variants and fall back to setTimeout.

Q: What could I use to recreate Legend of Zelda?

A: Check out Akihabara(http://www.kesiev.com/akihabara/). Some of the examples are in the retro console style.

Q: What is the relationship between WebGL and HTML5? How does it relate to Canvas?

A: Canvas2D is a 2D drawing API. WebGL is a 3D drawing API. WebGL is hardware accelerated whereas Canvas2D is not. Both APIs use the Canvas tag for their drawing surfaces. All three are commonly considered to be part of HTML5.

Q: I'm a Java developer... can you suggest a page to convince me that HTML5 is awesome?

A: Check out the HTML5Rocks slide deck (http://slides.html5rocks.com). There are also a number of tutorials at the HTML5Rocks site(http://www.html5rocks.com/en/), even one penned by yours truly. Because you are a Java dev, you might also want to check out PlayN (http://code.google.com/p/playn). It's a game library that allows you to write in Java but build HTML5, Desktop Java, or Android games.