I am developing a JavaScript/HTML5 game and obviously anyone is going to be able to read the code, which I would rather not have happen.
I appreciate I can’t stop people reading the JavaScript; I can make it more difficult by obscuring it, but not stop it.
I could convert it to a Java applet (I suspect reverse engineering these is still possible, but I think it would be harder) with just a thin JavaScript wrapper (if necessary).
Someone also mentioned it might be possible to use jQuery and JSON, but I suspect that the client/server interactions may be a bit to slow to make this practical.
Does anyone know of other ways of deterring people from ripping off my work?
True, although the Closure compiler in advanced mode makes the code almost entirely unreadable to human beings. (It also optimizes it, inlining where appropriate [in case the JavaScript engine running it later doesn’t], removes dead code, and makes identifiers as short as possible, and a bunch of other things.)
Yes, it’s entirely possible. There are tools to turn Java bytecode (what would be delivered to the client) back into readable source. Variable names and several other things are lost, and the code may look a bit odd, but the tools are there. I’m not at all sure it would be harder than dealing with the Closure compiler’s advanced-optimized version, though, frankly.
They must not have understood, those are also entirely readable by the client.
My best advice is the Closure compiler. Failing that, if you’re willing to go the proprietary route, use Flash — but Flash apps, like Java applets, can be reverse-engineered. I have the impression it’s harder than reverse-engineering Java applets, but I don’t know a lot about Flash.