views:

74

answers:

1

Hi,

I want to port a simple game someone else has written in Java to GWT. He organized it mainly into two packages: One for the user interface and one for the game logic. Hopefully, I can reuse his game logic and just rewrite the user interface, but I might need to change some things in order to make it compile with GWT.

I'm wondering on how to best reuse his game logic code. It's open source, so I have a range of possibilities. Should I use git's subtree merge or submodules features to somehow fumble his code into my repository? Or should I just gulp copy and paste the game logic code? If I do the latter, it would be extremely difficult to contribute back to the main project or inherit improvements and bug fixes from it.

I asked him whether he would like to split his game into two projects: One for the UI and one for the game logic, but this would lead to problems as soon as I have to change the game logic code to make it compile in GWT. Furthermore, he didn't like the idea of splitting a single application into several projects, he wants to keep it simple and I respect that.

How can I best approach this port? I presume it has happened before, i.e. when porting piece of Java software to JavaME or vice versa.

A: 

If you does not want run the game logic on the server then you can forget to contribute back. You can copy the logic code and convert it line for line. Or compiler error for compiler error. This is approx. 10 times faster as a new writing but will consume many time.

The problem is that you in GWT has only this what in JavaScript possible is. 95% are not a problem but the last 5% are difficult and consume the time. If you have compile it then you start with the next step. In general you need to do many performance optimization to reduce the download size. Split the code to multiple scripts, etc.

Horcrux7
Okay, then I'll just copy it. I already noticed that I will have to change a few things...
Noarth