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.

Tags: HTML5 Dev Center, HTML5 Tutorials & Articles, javascript, WebGL
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 written more than 1,000 articles for SitePoint and you can find him @craigbuckler

  • Alex Hall

    This is phenominal! It runs very smoothly, is very hard to control and looks impressive!

  • USPaperchaser

    Game sucks, doesn’t work on IE.

    • Craig Buckler

      I did mention that it’s WebGL browsers (Chrome and Firefox) only.
      But have you tried IE10?

  • Blake Petersen

    =D. SO COOL! and it runs so SMOOTH! Shocking how well it works, definitely true how it blows flash out of the water.

  • Jensa

    Try this one
    (Unreal Epic Citadel)


  • David Woodthorpe

    Solid 60fps with no problems – looks like the way ahead!

  • Andrew L Ayers

    I want to know when/where the source tarball is going to be released; Trigger Rally (the original) is a GPL’d game (-not- LGPL) – as such, any derivatives (including this one; perhaps minus artwork) source code should be released back to the community. I know it might be possible just to grab via the browser or maybe wget (though you’d have to recreate the server side code) – but that isn’t how GPL is supposed to work. Does anybody know the author’s contact info (I sent a tweet; not sure it will do any good)?

Ending Soon
Free SitePoint Premium

Get one free year of unlimited book and course downloads on SitePoint Premium!