2

This isn't really a code related question, and if it belongs on programmers SE then please migrate it.

I'm working on a project with two other people: I'm doing the PHP/Databases/anything networking related, and I have yet to decide what the other two less experienced programmers are going to do.

If one was to make a browser based game that is multiplayer, should I get the other two to write the basics for the game in Flash or JavaScript?

After they write some code, I will have to review it and link the php and such, but I'm not that familiar with Flash or JavaScript. Which language should I recommend they write the basics in?

5
  • Always write web based applications in JS if you can help it as it does not require any third party plugins (adobe flash player) and it is more widely used in the WWW in careers as well. Commented Jan 4, 2012 at 15:01
  • @DarkMantis thats a legitimate answer... you should put it as an answer Commented Jan 4, 2012 at 15:05
  • @DarkMantis "it is more widely used in the WWW in careers as well" [citation-needed] Commented Jan 4, 2012 at 15:07
  • If you/they are not familiar with either, start with JavaScript. I've done a lot Flash myself and it can be powerful when used correctly; however, if you ever want to play the game on an iOS device from a web browser, you'd have to rewrite it in JavaScript anyway. Commented Jan 4, 2012 at 15:13
  • If sound is important for the game, Flash may still be the right choice. Sound API in JavaScript is currently not quite up to synchronized game sound, as I understand it (areweplayingyet.org). Many of the HTML5 showcase games currently on the web, like Angry Birds for Chrome, Bejeweled, and the Goggle Doodle PacMan for example, rely on Flash for the sound. Commented Jan 4, 2012 at 18:46

3 Answers 3

3

The best answer is: if you can do it, write in NaCl. Hold tight, I'll explain :)

JavaScript is ultimate crap. Flash is less so, but they stand too close to each other to really tell the difference.

There is a way, the future should be, as in the best case: the browser vendors agree to standardize the virtual machine, and then we will have plenty of languages to use on the web, better and best. So far we are only limited to an excavated AlphaBasic-like slowpoke JavaScript and extremely unfriendly to end-users, Flash, which is almost the same as JavaScript, except for it doesn't manipulate DOM of HTML pages, but has it's own means of displaying things, and is considerably faster.

Why use NaCl - a technology, although not widely supported, it is ideologically right - it is an interface for you to run everything you wish the way you like it. You won't find any old cagers like Brendan Eich, who live in the middle ages of programming and would oppose any reasonable innovation to "their" language. Neither battling enterprise giants, driven by marketing concerns only. Of course, Google is just another such enterprise, but so far they don't have to share their plans with anyone else, they can actually do it right, or almost right :) Google has taken very different from Adobe approach on this issue, and, hopefully, this will pan out well for them.

Adobe, or better said, Macromedia, at the time had these plans about Flash and JS running in the same VM, they even managed to convince Mozilla to join in the game and thus Tamarin project was started. The standardization committee lobbied the initiative, and thus JavaScript remained at version ES3 (the 2000 year standard). The proposed ES5 (the next version) is acknowledged by the authors to have major flaws. Besides, the authors would go on to say that they aren't fixing any defects, or canceling any improperly functioning features - this is because of "battling enterprises" involved, and no one willing to do any extra work, in order to actually make the language / development environment better. Instead, we got a brainwashing campaign telling us how HTML is the new thing etc.

There are some interesting efforts at abstracting the platform and writing the code using better tools, in a better language - Haxe would be my tool of choice if I ever considered one. It allows in a very intelligent way to program for Flash and JavaScript just the same. It is also possible to write C++ in Haxe, so, even though no special binding for NaCl exists, this shouldn't be impossible in general.

PS. Sorry for the long post and the "politically-engaged" reaction. I just couldn't miss the opportunity :)

Sign up to request clarification or add additional context in comments.

Comments

1

Since you have mentioned "Game" , Let them start working on Flash (Designing game objects , screens ) . Flash is gifted with Actionscript, so all the key presses or mouse clicks in a game can be captured. So you let them do all this job.

Your work will be saving all the data (for eg. scores in a game, user profile data) to your server using PHP from Flash actionscript LoadVars() in-built function. (for hand-shaking)

Hope it helped.

3 Comments

What? "Flash is gifted with Actionscript, so all the key presses or mouse clicks in a game can be captured." You can capture key presses and mouse clicks with JavaScript too, y'know.
Even though any future projects I'll do in JavaScript, I've enjoyed developing in Flash for a few reasons, including: a built in debugger, a designer friendly IDE, strongly typed datatypes, prebuilt datatypes, decent documentation, etc ... That said, JavaScript can be pretty powerful, especially when using jQuery or other js based frameworks and it doesn't require plugins, which give it a strong advantage.
@MДΓΓ БДLL , Well i didnt say you can't with JavaScript. Did i ? But you can't design better interfaces compared to Flash.
1

Always write web based applications in JS if you can help it as it does not require any third party plugins (adobe flash player) and it is more widely used in the WWW in careers as well as far as I could tell from my experience.

You could also add server side functionality using NodeJS which would allow multiple users to play at the same time on the same game, Like a multiplayer mmo or whatever sort of game you wish to create.

[Added as an answer]

5 Comments

Actually, I never stated anything to say that my opinion was a fact. Secondly, I didn't say that AS/Flash is less used than JS for webbased games, I said it would be better practice to write the games in JS rather than flash as JS doesn't require a third-party plugin to run it. </of>
All I am saying is that it should not be a must for a user to have to download a plugin for something for them to use a website. Which is why I said the above. Yes, I do use Firebug, etc, but that is my choice. It is not a neccessity to download and install it if you want to be a web-programmer or what ever.
How is JavaScript bad technology for performance and security. The performance depends on the spec's of your computer amongst other things of course. As for security, as long as you don't use JavaScript to check anything such as usernames, passwords, or any data like that then it should be fine. Javascript is a very widely used system now, esspecially with all of the libraries out there for it, jQuery, Prototype (scriptaculous), MooTools, etc. I have never had any problems with using javascript for what ever reasons. Maybe agree to disagree? :P
That would be a great link to have a look at, I'd love to read that report as I think that'd be fairly interesting to read. On the other hand, if all of the data was sanitized correctly then I bet there would have been a lot less XSS vulns in there. Well I stand corrected on the JS Performance issues. I am always happy to be wrong as long as you can back up your statements to begin with :P I still wouldn't say that JS is bad to learn and do projects with as it is still widely used, despite of the performance issues ;) If you do get that link, I'd love to see it about the XSS in FB.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.