The HTML5 Center Blog

Building Games with HTML5

by Fahmida Y. Rashid (June 18, 2012)

In my last post, I discussed how developers can take advantage of HTML5's cross-platform capabilities and no-plugin architecture for their games. Casual games are the clear winners here, as developers no longer have to use Flash to crank out simple addictive games that can be played within the Web browser. However, there is no need to build game engines from scratch, as there are plenty of options already available.

Behind "Marshmallow People: Bored to Death"

Recently, the Internet Explorer team put together an in-depth "behind the scenes" post discussing the development process behind the game "Marshmallow People: Bored to Death." Designed for Internet Explorer 9 using JavaScript and HTML5, the game is a browser version of the arcade game Microsoft had originally developed for an event at the 2012 SXSW Interactive back in March.

Not building from scratch

The in-depth view outlined some of the technology decisions the team made while building the game, such as deciding not to create a game engine from scratch. Instead, the team chose Impact JS, a commercial Javascript/HTML5 Game Engine with a built-in world editor. With Impact, the developers had cross-browser compatibility, powerful debugging tools, and a level editor straight out of the box. Another decision was to use Grant Skinner's Create JS suite to build the non-play elements, such as the high score and introduction screens.

The team also referenced two libraries, Underscore.js and EaselJS. Uderscore.js is a "utility-belt library" with over 60 functions that handle basic functionality as well as some specialized features. EaselJS acted as a bridge between both frameworks, CreateJS and Impact, and made sure the engines were acting in sync.

The arcade-style brawler is a lot of fun to play (there is even an option for a second player join the game using the same keyboard), too.

Reference materials

ood developers regularly bookmark reference Websites and keep them on hand to lookup code snippets, API documentation, and command syntax. The Web is chock full of sites with nifty tricks and tips for developing in HTML5. BuildNewGames.com is designed to provide information specific to game developers interested in writing plug-in free games that reliably works in all modern browsers including Chrome, Firefox, and IE.

Just launched in April, the site is still in the beginning stages, but there are already several articles available discussing how to use HTML5 Canvas tags, take advantage of WebSockets for real-time data transfer, and incorporate vector graphics. Another piece examines some issues unique to mobile game development, including hardware performance, handling touch controls, and sound.

Using 2D game versions as lures

Yes, a majority of the Web-based casual games are still built with Flash, but the number of HTML5 games is steadily growing. For every game "experiment" that showcases the sophisticated animation, 3D capabilities, and advanced features that HTML5 is capable of, there are simpler 2D games that lure site visitors in. Games such as "VII", a monochrome platform world where the game character walks, surfs, and jumps its way through each level; "SandTrap", where the goal is to pour sand out of a maze; and the "World's Biggest Pac-Man", where you can switch between a large collection of Pac-Man mazes, are examples of how other developers have already taken advantage of the HTML5 goodness in their games.

What's your experience?

There are quite a few tools out there, and more are on the horizon, but I am curious to hear from you: What tools are you using for your HTML5 projects? Are you using commercial packages or exploring other available tools on GitHub and similar repositories? How do you evaluate which engine to use? Share your thoughts in the Comments section below.

About the Author
Fahmida Y. Rashid is a contributing editor for Slashdot and SourceForge.




Sponsored Links

Previous Blog Posts

  • Windows 8 & Store: Code Once, Sell Many

    With Windows 8 and the Windows Store, Microsoft is trying to close the gap between the mobile device and the PC. Wide-scale adoption of HTML5 is instrumental to its plans.... read more.

  • Still Opportunities Aplenty for HTML5 Developers

    It's no secret that major social networking sites such as Facebook and LinkedIn have abandoned high-profile HTML5 projects in favor of mobile native app. But there are still plenty of opportunities at enterprises for developers with strong Web-based skillsets.... read more.

  • Intel's Free Dev Platform Boosts HTML5

    With the launch of a free development and testing platform for platform-independent Web applications, Intel has thrown its hat into the HTML5 ring and given the emerging standard an important nod.... read more.

  • Native or Mobile App? Depends

    Businesses grappling with mobile strategy have to decide whether to invest time and resources into developing a native app, or into improving their mobile Web experience.... read more.

  • Beyond Cross Platform Development: Security, User Benefits of HTML5

    We've looked at how HTML5's features can be manipulated to craft malicious Websites, or to exploit applications to perform unauthorized tasks. But HTML5 also introduces new features to help developers write more secure, plug-in free, cross-platform applications. In a recent interview, Mike Shema, director of engineering at cloud security company Qualys explained these benefits of HTML5.... read more.

  • Chrome, IE, Safari: Handling HTML5 Storage Incorrectly?

    As HTML5 gains traction among developers, researchers are increasingly looking at how poor implementation and sloppy development practices could cause problems for end users.... read more.

Recent HTML5 Tweets

HTML5 Topics on Slashdot

Featured Webcasts