By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,693 Members | 1,671 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,693 IT Pros & Developers. It's quick & easy.

Javascript book for gaming?

P: 7
I am trying to create an online game with others and javascript is a key part of it... I know java but not javascript - any suggestions for good books toward online gaming development? I have listed a few below i searched online.. any suggestions to any? thanks!

Professional JavaScript for Web Developers (Wrox Programmer to Programmer) by Nicholas C. Zakas

Head First JavaScript

Learning JavaScript, 2nd Edition by Shelley Powers

Learning PHP, MySQL, and javascript: A Step-By-Step Guide to Creating Dynamic Websites (Animal Guide) by Robin Nixon

Beginning JavaScript by Paul Wilton and Jeremy McPeak

Beginning HTML, XHTML, CSS, and JavaScript by Jon Duckett (Paperback - Dec 30, 2009)

Beginning Scripting Through Game Creation by Jeanine Meyer (Paperback - Jan 25, 2008)
Jan 12 '10 #1
Share this Question
Share on Google+
12 Replies


P: 86
Most books about online game development do not center around Javascript. If you are looking to create the next runescape, do not use javascript. It is too slow. Given that you are developing this project with others, it sounds like a bigger project that maybe java or flash would be better suited to (and you'll find more books).

If it's a small, simple game with no sound requirements then you probably don't need specilised knowledge of how to build a game in javascript. Javascript is a very simple language which can elegantly manipulate an HTML page. As long as you have a clear idea of what needs to be manipulated, and when, any javascript book should give you the tools you need to do it.

If your game has more complex graphics requirements, you would be better off using something like jQuery. jQuery books are also available but I've never used it. The jsDraw2D and Walter Zorn graphics libraries draw non-standard shapes, such as curves, using javascript (which jQuery doesn't do) but to use them you'll need some basic javascript knowledge anyway.

So if you really need to use javascript, I would say any of the below books but especially those which deal exclusivly with javascript because these usually go into more detail.
Jan 13 '10 #2

P: 7
thanks for input. Well we are doing a browser game and isnt javascript good with not reloading etc all the time? and the game is not going to be graphics intensive as well either. Is there some major hurdles with javascript? and is flash better all around?
Jan 13 '10 #3

P: 86
True, javascript doesn't need to reload all the time. Neither does flash, for that matter, or java. Javascript is slow on graphics and so on - especially if you want to draw lines or curves (as opposed to boxes and pictures). The other "major hurdle" with javascript is the lack of sound support. Sure, you could use an <embed> tag, but not all browsers support this. Also, none of these languages can actually do anything server-side. Using technology called AJAX, javascript can read files from the server but not write them - so if you want a "persistent" game people can return to, you'll need at least some CGI or PHP or ASP.

Personally, however, I prefer javascript to flash because:
  • it's free
  • it's easier to learn, in my opinion
  • code is simple to manage, as it's a single script and not a load of behaviors attached to objects
  • you can intergrate it with your HTML code easily, forms look natural because they're HTML etc

So yeah, if it's small and simple, go for it!
Jan 13 '10 #4

P: 7
it's prob ably wont be small or simple - it will be served with goal of hundreds/thousands players play simultaneously in one session. but there will be no sound and it will be low graphic so i guess java script still decent?
Jan 13 '10 #5

acoder
Expert Mod 15k+
P: 16,027
When you say playing simultaneously, do you mean multi-player? If so, you will need some server-side code too. What is the game supposed to do, i.e. how complex is it? If it's going to be quite complex, you may need to look at memory, efficiency, performance, code size, page load time, etc.

PS. most of those books are general books, not necessarily geared towards gaming.
Jan 13 '10 #6

P: 7
yes i mean multiplayer. Basically players all play on the same map and there will be server side coding needed (in php/mysql). Javascript will be the front end stuff. The game is basically you build towns and fight eachother using different units. but we think java script will be good for the front end? If those books might not be good do you have a suggestion for another? thanks
Jan 13 '10 #7

Dormilich
Expert Mod 5K+
P: 8,639
well, looking at your book list, JavaScript for Beginners may not be enough, since OOP might be better suited here (although that depends on the complexity of the script). I think, you should use a framework to write the code.

points of interest:
  • what is OOP (what can it do and what not)
  • JavaScript objects & the "this" keyword
  • interfaces, DOM & Events
  • prototype based inheritance
  • Closures
  • AJAX
Jan 13 '10 #8

P: 7
OOP you mean object oriented programming right? Yeah we are going to have to use AJAX since we dont want to reload all the time. DOM also came up in our discussion as well.

what about:
Professional JavaScript for Web Developers (Wrox Programmer to Programmer) by Nicholas C. Zakas

Beginning HTML, XHTML, CSS, and JavaScript by Jon Duckett (Paperback - Dec 30, 2009)

Beginning Scripting Through Game Creation by Jeanine Meyer (Paperback - Jan 25, 2008)

? I think the first 2 focuses on related technologies i will be using - html, css and web. The last book i am not sure how it will fare....
Jan 13 '10 #9

Dormilich
Expert Mod 5K+
P: 8,639
well, I can’t really help you with books, because I never really used one.
Jan 13 '10 #10

P: 7
any good sites you found very good for beg-adv? There are a lot of sites to go through heh...
Jan 13 '10 #11

Dormilich
Expert Mod 5K+
P: 8,639
Iíve been reading quite a bit at A List Apart. the other stuff is just googling for articles/blogs having advanced topics Ö and then practice.
Jan 13 '10 #12

acoder
Expert Mod 15k+
P: 16,027
Check out some of the links in the Offsite Links sticky thread. One that is always recommended is MDC.
Jan 15 '10 #13

Post your reply

Sign in to post your reply or Sign up for a free account.