Palagpat Coding

Fun with JavaScript, game theory, and the occasional outbreak of seriousness

Friday, December 19, 2008

Cloning Zelda in JavaScript: Part 1 of ?

Inspired by all of the HTML 5 Canvas-powered JavaScript games that have been popping up, I wanted to see what all the fuss is about. Now I know... it's 2:30 in the morning, I've been working on this for the past 5 hours, and I'm forcing myself to blog my status and go to bed.

Anyway, I've noticed that, despite all of the dozens and dozens of online Super Mario clones (all of which my 6-year-old has on the main tab of his iGoogle page, but that's a story for another day), there aren't any webby Zelda clones! So I decided it was up to me to take up the challenge... as a programming/learning exercise, I've started writing a pure JavaScript (no Flash/Flex/Java/etc) clone of the original NES game "The Legend of Zelda".

So far I've got the overworld map in, and the player character (Link) can move from screen to screen (albeit without being constrained by things like mountains and oceans, because I haven't implemented collision detection yet!) Keyboard support is in, but there's also a set of buttons duplicating the NES controller which you can use as well: The Legend of Canvassa (yeah, I know, stupid name... =P)

Since this uses the <canvas> tag from HTML 5, it currently only runs in Firefox 2+, Webkit and Opera 9; IE users are out of luck. (Yes, I know there are hacks that enable IE to emulate Canvas... but so far I haven't been able to make them work with my code). I've successfully tested it in Firefox 3 and Chrome, so in theory at least it should work in Safari (Chrome and Safari are both Webkit-based, after all). Opera I don't know.

Anyway, this is only Part 1 of what could potentially be a lengthy project, and I suspect I'll continue to scratch this itch over the coming weeks, so look for more updates as they come.

Labels: , ,


Post a Comment

Subscribe to Post Comments [Atom]

<< Home