So I love javascript as a language and how it is able to be run anywhere. I'm gonna enumerate my concerns:

Does it make sense to make money from javascript? I mean, the second I publish my game online, people can download it, and post it on their own site and put their own ads into the game. There are rumors that Facebook is working on an HTML5 platform. Still, even if you require the use of secret keys with your online part of the game, people can still just download the source code and implement their own online version. It's a little inconvenient, but the game itself didn't lose any value. They just need to build their own community now - which should be easy with a great game. I don't have a smartphone, can someone explain if it's possible to view the source if I publish my game as a javascript application? (maybe it's wrapped into native code by the marketplace, I would appreciate the information)

I know Flash is somewhat similar, but it's my understanding that good obfuscators can effectively make the source code so ugly that it would be a mountain of work to modify. Native games can be cracked too of course, but that doesn't mean they have the source code. They'll still rely on my online part and my updates to the game.

Tell me I'm not paranoid :) How can someone justify spending resources on a javascript game?

  • 2
    \$\begingroup\$ This question is very similar to this question and this one \$\endgroup\$
    – XGouchet
    Commented Aug 2, 2011 at 12:50
  • 2
    \$\begingroup\$ Look into open source game development. There is no reason why it can't work \$\endgroup\$
    – Raynos
    Commented Aug 2, 2011 at 12:59
  • 3
    \$\begingroup\$ .. or implement the main game logic on the server and just write a "dumb" client in JavaScript. \$\endgroup\$
    – bummzack
    Commented Aug 2, 2011 at 14:06
  • \$\begingroup\$ @bummzack (+1): For a multi-player game, the server should be making all the important decisions anyway. \$\endgroup\$ Commented Aug 2, 2011 at 15:27
  • 1
    \$\begingroup\$ @bummzack, if you want to have lag tolerant game, the client will need to be able to run its own simulation as well. \$\endgroup\$ Commented Aug 2, 2011 at 16:44

3 Answers 3


Does it make sense to make money from JavaScript?


If you can write a game (or nifty tool, etc.) using the programming language that you prefer, and it becomes popular enough that you can get users to pay for subscriptions and/or click on banner ads (or be financially beneficial to you in some other way such as by selling licenses to re-use your source code), then you'll have succeeded.

Perhaps the question you might want to ask though is "Is it possible?" which is where the "popular enough" aspect comes into play. It really boils down to what your potential customer base likes (in this case, the people playing your game), and if they really like your game then you have one of the more important elements to make it possible to turn it into a success (other elements would be the offset of operational costs such as server hardware and bandwidth, or hosting costs, support staff costs {if you end up needing support staff}, etc.).

Technological challenges

One of the problems with JavaScript programming is that each web browser implements it a little bit differently (and then there's one, which I shall not name, which implements it so differently that developers regularly have to code special work-arounds that are used conditionally based on whether the user is using that web browser).

Although most of these work-arounds are very well-known, they do come with the burden of needing more development resources (such as more time for testing with all the major web browsers). Note: I'm not trying to discourage you, I just want to make sure you are aware of this common problem before your start.

Of course, each language has its challenges, so you may benefit from spending a bit of time researching the "pros and cons" of the various languages available before making your decision.

Source code obfuscation

Although obfuscation may seem to be a popular move, if you really are worried about this then perhaps JavaScript isn't the right language to use -- you may need to evaluate other options where the source code gets compiled into some form (such as Java's byte codes or a native executable for the target Operating Systems you're interested in).

Also, when it comes to source code obfuscators, there are also de-obfuscators which can aid significantly in the reverse-engineering process, so you may find that obfuscation doesn't actually provide as much protection as you're hoping for (and it could very well be a wasted effort for the most part). What obfuscators can sometimes provide is a bit of optimization in that variable names are shortened (so the JavaScript interpreter has a few less characters to sift through), but on the client-side this may not be very noticeable.

One aspect to consider as well is that if you are constantly updating your JavaScript code, copying could prove to be a lot of work for a third party because they'd always be having to keep their copied system up-to-date, especially when major changes are introduced.

If your server is making all the decisions, then only the client-side of your source code would be available to the general public, so it might not really matter since it's the server that would be running the majority of the really important code anyway.

Flash vs. JavaScript

Flash and JavaScript are generally focused in different directions, although either one can often be used for many of the same tasks. Of course, when it comes to the need for fast graphics, Flash is usually the more suitable choice between these two; if your game doesn't require the type of fast graphics that Flash is well-suited for, then I certainly don't see why you couldn't use JavaScript without much trouble.

Take a look at http://maps.google.com/ for one example of JavaScript being used in a graphics-heavy client-side application -- it uses JavaScript (and more specifically AJAX) to essentially download tiles that are pieces of photographs of the Earth that previously came from orbiting Satellites, and lets the user use the arrow keys and the mouse to navigate in various ways. If this kind of performance will suit your game design needs, then it may make JavaScript a more viable choice for you.


You're not paranoid. There, you've been told what you wanted to be told. =)

Justify spending resources

Open source isn't the only consideration...

When it comes to spending money, a business plan can be very helpful -- understanding your market (potential customer base, competitors, etc.), your budget (costs for equipment, services, marketing, sales projections, etc.), your eventual staffing requirements (developers, artists, technical support, accountants, etc.), etc., can be very helpful, especially if you're serious about making a business out of this.

For every investment, there's always a risk somewhere (although the risks aren't always apparent, so investors may identify different risks). The bottom line is that investors expect a profitable return on their investments, and so they'll want [at least some] assurance that you can overcome the risks.


You are paranoid.

There is such a thing as copyright, which means that people stealing your application are eligible for being sued. It's not really different from other programs.

  • 1
    \$\begingroup\$ There are also different jurisdictions around the world which means that even if you would manage to find the human being responsible, it might be completely unfeasible to bring them into any kind of court. \$\endgroup\$ Commented Aug 2, 2011 at 20:23
  • \$\begingroup\$ so who is going to sue these people all over the world then? because I don't have the money or time to do that. \$\endgroup\$
    – Blub
    Commented Aug 4, 2011 at 13:13
  • 2
    \$\begingroup\$ I'm not saying it ain't a problem, but the problem is basically the same for all software. Good news is, under any decent legislation the threat of a lawsuit is almost always enough, one would be foolish to go to court over copyright infringement if given a reasonable way to bail out. \$\endgroup\$ Commented Aug 4, 2011 at 15:18
  • \$\begingroup\$ Some countries aren't known for respecting copyright (Russia and China both come to mind immediately, although China is just starting to improve in this area lately), and so your protections will likely only extend to those countries which do respect, and provide enforcement mechanisms for, intellectual property rights. No matter what you do, copies of your software will probably end up for sale in those countries (if it does, it may at least be an indication of how good it is -- or at least this attitude may make it easier to swallow when your software does get copied illegally there). \$\endgroup\$ Commented Aug 4, 2011 at 15:48

It is definitely feasible to develop and monetize a product built on JavaScript. It is a widely used and supported language which makes it easy to scale and cost effective.

Also do note that JavaScript can be run server side, so your logic does not have to be exposed. Consider Node.js


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .