Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm hearing about the new HTML 5 features which allow graphics to be rendered, audio to be played, etc. My question is, does that mean Javascript is ready for a graphics intensive game, or is the better option still to use Flash or Java?

What are the graphics capabilities of Javascript, can it only render simple 2d graphics (like a tetris or pacman game), or can it be used for a fast shooting game or a car racing game as well? Do the graphics run smoothly or are they laggy? And what about 3d graphics?

Same question with the audio capabilities, are they laggy, smooth? Can you smoothly play music in the background and also play sounds in response to user actions (like when he shoots a gun)?

Thanks.

share|improve this question
    
Anyone still uses Java for browser-based games? I think it's all Flash(/Shockwave) or HTML5+JS nowadays –  ThiefMaster Aug 20 '12 at 11:30
3  
@ThiefMaster Minecraft –  Laurent Couvidou Aug 20 '12 at 11:38
    
@Click Upvote: what are your specific requirements? 2D? 3D? –  Laurent Couvidou Aug 20 '12 at 11:39
2  
Voting to close as too localized as answers to this question can change quite quickly or even become invalid in a short period of time. –  bummzack Aug 20 '12 at 11:44
1  
The OP said Javascript, not browser. Most JS is used on the web clients but it is not limited to browsers anymore. –  Gil Zumbrunnen Aug 20 '12 at 11:57
show 7 more comments

1 Answer

The answer is hard to define and is more a question you should ask yourself depending on the game you're about to create.

Technically, everything would be ready for a neat 2D game, for 3D you can either go with HTML5 and a 3D engine, or start your way up with WebGL.

Nowadays the biggest problems are compatibility and performance. Your game might work well on your i7 CPU on a fast browser, but will be totally unplayable on a netbook with internet explorer. Also, Microsoft has a good history of promoting their own technologies, IE10 might not go the WebGL way in order to promote DirectX, especially since you can code apps for Windows with web languages. You need to define on what system you're planning your game to play on, if you focus on a particular system you can optimize towards it and use the technologies it supports. Keep also in mind that if the game is not stored locally you will need to take the bandwidth into account.

2D games are usually working smoothly on almost any system and can be used to create iOS simple games, with some limits of course. Depending on the game you don't necessarily need HTML5 Canvas and you could first try with plain old "DHTML".

No problem playing sounds if the browser supports HTML5 Audio API, which can be accessed with javascript and doesn't require a proper html tag.

So I'd say yes it is ready, but it greatly depends on your targets and if you are willing to spend a lot of time to optimize to the last bit every line and events of your code. And don't dream about simply putting your game online, thousands of users will not understand why their IE cannot run your game.

share|improve this answer
    
How about a 2d side scroller like mario, would it be playable in most browsers? Also, how about a multiplayer racing game? –  Click Upvote Aug 20 '12 at 13:35
    
Check this one out : blog.nihilogic.dk/2008/04/super-mario-in-14kb-javascript.html Well, it's pure js and it's working fine with a few sprites. You could try to convert it to Canvas to get used to the APIs and then roll your own code with whatever fits your game. –  Gil Zumbrunnen Aug 20 '12 at 13:57
    
A racing game will depends on the view you will choose, if you go for a "from the top" view like GTA you could easily adapt a scrolling game to work on axis Y as well. Regarding the multiplayer part, it will require a server-side code, and most likely with a way to push info from the server to the client. Certainly possible but you will need to take that into account when you consider the performance. –  Gil Zumbrunnen Aug 20 '12 at 14:02
    
Basically you can do most stuff with HTML5 these days, if you're a doubter just check out a few demoscene web browser demos and intros. However, and this is a big however, it will depend a lot on which browser you target. Like in the old days, a lot of the high-end demonstrations and games will require very specific versions of very specific browsers. The Audio dilemma is even more troubling and will require some serious workarounds to target even a few browser versions. It is also almost hopeless to get a properly timed loop going, so slight stuttering and tearing is a big problem so far imo. –  Oskar Duveborn Aug 20 '12 at 14:50
1  
The Html5 version of Cut the Rope run into a few issues with sound in html5 nerdplusart.com/… –  Daniel Little Aug 21 '12 at 4:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.