Haxe and native (iOS, Android, html5) interop



  • I'm working on an online game that will communicate with the backend using gRPC protocol. There are gRPC client libraries for iOS, Android and JavaScript.

    The plan is to implement the game logic and rendering using Haxe, but networking using native code. What's the recommended approach for that? I can see 2 options:

    1. Implement and build the game using Haxe in a way that it exposes some methods to native, e.g. a method to update game state using server data, and also accepts some callbacks from native, like a callback that is called every time the player makes an action that should be sent to the server. Then the callbacks and appropriate method calls can be implemented in the native projects generated by Haxe, using native tools like Xcode.

    2. Implement networking using native tools like Xcode and expose them to Haxe somehow. Then the game logic written in Haxe will call native methods and provide callbacks implemented in Haxe to native.

    What's the recommended approach? It seems to me that the first approach might be simpler and have less potential issues. If you could also point me to some articles about that, it would be great, since I haven't found anything detailed enough.


Log in to reply
 

Looks like your connection to HaxeFlixel was lost, please wait while we try to reconnect.