Skip to main content

Trigger Rally: Unleashing the Potential of HTML5 Games

Share:

Free JavaScript Book!

Write powerful, clean and maintainable JavaScript.

RRP $11.95

You’ve no doubt played a few HTML5 games. While they’re technically impressive, many are limited demonstrations or offer a simplistic gaming experience reminiscent of platformers, puzzles and shoot’em-ups we played in the 80’s and 90’s. Few game developers consider web browsers to be a good substitute for native OS or Flash code.

I thought the same. Until I played Trigger Rally Online.

Trigger Rally Online

The game is a JavaScript port of Trigger Rally, an open source single player 3D racing game for Linux written in C++. It uses canvas, WebGL and the three.js library.

The online edition works in WebGL-enabled browsers. That’s currently Chrome but also Firefox 10 if WebGL is enabled for your graphic card and you can live without sound. Even on modest hardware, you should achieve 20 frames per second. If you can’t play it, take a look at the YouTube video.

Technically, Trigger Rally uses a JSON-defined height map to for level geometry, a color map in combination with an image to paint the geometry, a foliage map to place plants on the landscape and checkpoint coordinates to define the race path. It should be possible to create your own maps so I wouldn’t be surprised if someone’s working on an online editor. Sound is generated using the Web Audio API. A standard engine loop is pitch-shifted in real-time as you accelerate and decelerate. It’s simple but effective.

Quite simply, the game is astounding. While it’s currently little limited to one car and course, it demonstrates the potential of HTML5 games. If anything, it’s better than any of the 3D games and examples I’ve seen created in Flash.

Do yourself a favor and “investigate” Trigger Rally Online. It’s Friday, after all.

Craig is a freelance UK web consultant who built his first page for IE2.0 in 1995. Since that time he's been advocating standards, accessibility, and best-practice HTML5 techniques. He's created enterprise specifications, websites and online applications for companies and organisations including the UK Parliament, the European Parliament, the Department of Energy & Climate Change, Microsoft, and more. He's written more than 1,000 articles for SitePoint and you can find him @craigbuckler.

New books out now!

Get practical advice to start your career in programming!


Master complex transitions, transformations and animations in CSS!