Jump to content

How much javascript should I know before going into game development with it?


albania-2014
 Share

Recommended Posts

ok so to start off, I am inspired when I see games made in html5.

I am reading a intro book to javascript by microsoft.

I am very comfortable with the basics, had no problem at all learning them, I am even playing around with the code to achieve different things. I want to use a javascript library that makes game programming much easier.

My question is, will it be difficult without intermediate/advanced knowledge, or would I just have to learn alot of functions, and possibily new things in the javascript I have not been introduced to yet?



Thanks
T

Link to comment
Share on other sites

I don't think you need to know the JS language features inside out for canvas based game development.

 

I suggest you to learn everything about if, switch, for, while, objects, natives, functions, scope (!), closures (!), code patterns (!).

And of course the featureset of the game engine you want to go with.

 

That should be enough knowledge to write games in that specific direction.

Link to comment
Share on other sites

I think Chris summarized what you'd need to know pretty nicely, but what he alluded to covers a LOT of ground.  However, learning JavaScript will pay big dividends over time.

 

So the question is, how patient are you prepared to be?  If you just can't wait to get a game out, GameMaker or Construct 2 will get you up and running a lot faster than if you use JavaScript without FWs like this.  If you do decide to go the JavaScript route, a JavaScript-based FW such as Phaser will save you a lot of time, but not as much time as if you used GameMaker or Construct 2.  To a degree, it depends upon the nature of your game.  If your game is not too ambitious, you can probably go about it using any of these methodologies and not spend a long long time doing it.  Depends upon how much free time you have.

 

I myself prefer using JavaScript - by far - you get more control over your creation and I think more satisfaction.  However, I have fooled around with GameMaker and you can probably create a simple game in less than a week (including training time) using that system.  There is much less to learn and the underlying game architecture is built-in, along with an IDE that is designed to be a part of the process.  Bear in mind that there is some cost associated with using GameMaker (at least there used to be) - not to develop, but you need a module to be able to distribute a run-time version of your game.

Link to comment
Share on other sites

None! Get started making games right away :) You'll learn along the way.

 

Your first game can be something like High-Low or Tic-Tac-Toe in JS. Once that's working, visualize it using basic canvas functions. I think that's a great basis. Then decide whether you want to continue with an engine like GM: Studio or delve into a JS framework like phaser.

Link to comment
Share on other sites

Have a look at the source for the lessmilk games....

http://www.lessmilk.com/

....for instance....

http://www.lessmilk.com/4/js/play.js

....from.....

http://www.lessmilk.com/4/

 

He creates playable fun games that have bugger all code to them (thanks to the beauty of Phaser).

Try to get to the point that you understand them.  Look up anything that doesnt make sense till it does.  Ask questions here about anything that gives you real trouble and reference the source so others know where your coming from.

Link to comment
Share on other sites

I am talking about something like this

https://developer.mozilla.org/en-US/demos/detail/bananabread

Its a 3D fps compiled (converted) to WEBGL. (only works with firefox)

open source too.

The most advanced application in javascript history.

written in about 5000 lines of code.

 

edit: I don't plan on using tools without code. That takes all the fun and possibility out of it. What I might do though is use a tool that allows a mix of code and a set of prebuilt interface features.

Link to comment
Share on other sites

  • 2 weeks later...

That BananaBread demo is state of the art - newer than state of the art really - advanced stuff.  IMO, you are kind of thinking of running the four minute mile when you should probably be concerned about learning to walk as yet.  However, if you are interested in 3D stuff, there are at least two outstanding WebGL-based 3D JavaScript libraries that I know of: ThreeJS and Babylon.js.  ThreeJS has been around for a while now and is the established leader in the field.  Babylon is up and coming and as a matter of fact, has its forum hosted at this very site.

 

You seem pretty serious about this.  You might want to shore up your JavaScript a bit with perhaps any two of the following:

* JavaScript: The Good Parts, by Douglass Crockford (A classic - everybody should read some Crockford)

* JavaScript Patterns, by Stoyan Stefanov (kind of a continuation of Crockfords book, in spirit, if not in fact)

* Learning JavaScript Design Patterns, by Addy Osmani (there is a free online version of this one available)

* Effective JavaScript, by David Herman (A good all around how-to book, a little more down to earth than the above three)

These books contain approaches that are not necessarily HTML5 intensive, as they weren't written today, but they are still chock full of good stuff.  You should probably supplement the above reading with something more specific to the new features in JavaScript, i.e. object.create and the new properties stuff, etc.

 

...  and then look for stuff more specific to writing games.  There is at least one decent book available from Amazon about using ThreeJS and WebGL, but I can't remember the name at the moment.

Link to comment
Share on other sites

There are enough tools out there that you need to know very little javascript before making games. I suggest you try one of those (Game Maker, Construct 2, etc...) first. If after making a couple games you find that you need more javascript then dive in and start learning javascript. If you're happy with the games you make then don't worry about javascript and just make fun games.

 

It's really up to you and how you want to develop games.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...