We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Unfortunately, when it comes to more specific functions, as usage of sound or storage local data, the "multiplatformity" fails, since you need to write totally different code for JS and Java/Android. This is currently my problem, since I am working on a game, that aims to run at JS website, and as Android app.
Wouldn't be cool to have some conditional comments in code, that could be automagically commented/uncommented if you compile the code on different platform? Something like C preprocessor's #if command? For example:
I have started development a tool, that scans above code and, depending on mode, uncoments appropriate parts. So, running the tool while you're in Java mode will change the code to:
Therefore only parto for Java will be compiled.
This way, you can store different code variants for all three modes, and you don't manually change it anymore. Write once and just switch with two clicks!
The tool at rather early stage, but with full described functionality can be found here: https://docs.google.com/file/d/0BwyBGrLNFWABdDg1TFRqN0x2aUk (File → download)