This is a feedback for the article at http://buildnewgames.com/sprite-animation/. It contains code review, bug fixes and sort of improvements.
First of all, the article concerned contains a lot of jsfiddle demonstration. I think it's really nice as we can see the code, see the result and make our change as we like. But it seems like the usage of jsfiddle may be improved. Here is the trick: jsfiddle has 3 "fields" where we can type code (for HTML, CSS, and Javascript). So please stop writing every things like this http://jsfiddle.net/dariusk/wa8eV/light/, that's insane. What is easier to read between this http://jsfiddle.net/pomeh/tQE89/ and this http://jsfiddle.net/pomeh/tQE89/1/ ? If you pay attention to the source, I've modified the onload
function to make it an anonymous one. Here is why and what happens, and here are some solutions, from worst to best.
Also, you should be aware that jsfiddle output all your HTML code inside the <body>
tag, so you can't (and don't have to) type in your own <html>
, <head>
<body>
and so on tags. It will only produce invalid HTML code: have a look to the source code of this page http://jsfiddle.net/dariusk/wa8eV/show/ (this is also visible in the file "view-source for dariusk-wa8eV-show.html" present in this gist). Notice the tag soup like </head><body><!doctype html><html>
, it hurts !
The resize thing is not working. The onresize
method does not exist, it's only resize
. Check it out.
The image loading also contains errors. See what's wrong.