I'm sorry to say that, but jQuery is not the best choice for game
development. I believe in "go native or go home" here, jQuery hides
from you how complex and slow some operations are. If you need a
framework, use one intended for games, like Mibbu (http://mibbu.eu/).
Besides that your code is quite good. You may want to merge "var"
declarations. Also, try to avoid using switch, in javascript it may
fallthrough (http://javascript.about.com/od/hintsandtips/a/
fallthrough.htm). I'd say something about performance of slice,
unshift and other array functions, but I'm not an expert here. My
advise would be to check jsperf.com every time you want to use any
native function. Often there is a way faster implementation.
$(JS_SNAKE).trigger('appleEaten', [posArray]); why not normal function
call?

I'm waiting for your tutorial :)

Cheers,
Sebastian

On Jun 11, 8:01 pm, Nick Morgan <[email protected]> wrote:
> Hi all
>
> I've written a basic Snake game in JavaScript. It's available on jsFiddle 
> here:http://jsfiddle.net/skilldrick/bg7UF/(it's over 300 lines so thought
> a bit long for copy-pasting)
> (Also on Github if anyone's interested:https://github.com/skilldrick/jsSnake)
>
> I'm going to be using this for a blog tutorial on canvas, so I want
> the code to be as clear and 'correct' as possible.
>
> I'd really appreciate any feedback/constructive criticism you guys have.
>
> Cheers!
> --
> Nick Morganhttp://skilldrick.co.uk
> @skilldrick

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to