PDA

View Full Version : Mixing Java and Flash?


Jesse Aldridge
10-17-2006, 02:36 PM
Ok first some background...

My game framework is in the Java language. I'd like to be able to make both online, browser playable games and seperate, downloable games. For the online versions I'd like to use Flash. I don't want to use applets mainly because 1.) Portals rarely take them and 2.) The Java Plug-In load time can be excruciating on a slow computer. For a seperately download game I don't want to use Flash because 1.) I prefer working in Java, and 2.) Flash has no hardware acceleration.

igLoader is not an option (for now). Too expensive, and they'd still have to download the plug-in (it wouldn't "just go").

Now my question is...

How can I get the best of both Flash and Java? Right now, I'm thinking the best thing would be if I could take my high level framework - coded in Java - and "bind" it to seperate low level implementations in Flash and Java. For example I could have a Sprite class that handles movement and animation and stuff and then have it call a drawBitmap function that could map to either a Java or a Flash implementation. I've heard of this being done (mixing languages), but I have no idea how to go about it. Is this really possible? Can anybody point me in the right direction? And just how difficult would it be to pull off?

Thanks.

Indiepath
10-17-2006, 02:47 PM
igLoader is not an option (for now). Too expensive, and they'd still have to download the plug-in (it wouldn't "just go").
Hi Jesse,

Firstly apologies because I'm not answering the question you are asking. I just wanted to point out that igLoader is now free if you upload your game and have it hosted on pjio.com - and yes you can embed it into your own site - not sure if portals would be too keen on my in-loader advertising though :p

Tim.

Huge
10-18-2006, 02:32 AM
Hi,
I have also been thinking along similar lines - but with c++ and flash - possibly java too. The best I've come up with at the moment would be to write in a framework that is implemented in both c++ and flash - pretty much as you are thinking.

I think the big step here is to make the program data-driven as much as possible, since the data should be the same between versions. Then everything else would be some kind of scripting language. Current ideas on scripting include:
1. Write in c++ and use perl to translate to other languages. I'm not talking about a full-on parser here. Just some text based hacks. My coding style is pretty fixed, so this maaaaay work.
2. Write in some scripting language supported by all engines. eg, link in a flash/java VM into c++ or implement a lua parser in flash (???) (or any language of your own devising).
3. Use some 3rdparty scripting that builds bytecode appropriate to java/flash and link in a VM. I'm thinking here of "haxe" but have not looked into it fully.

Let me know how you go !