Convert a haxe project using hxcpp to python

137 views Asked by At

I found an open source project in haxe using lime/openfl, msignal, and hxcpp. Problem is, I have never in my life used haxe before. But I use python all the time at work (although I couldnt say I am a master by any means). All information I can find uses a build.hxml file and/or specifies a main class. This class uses a xml file to build it (just running it took me a few hours to figure out). Id much rather not learn haxe if I could avoid it, so if any of you have some insight to share on how I could convert this haxe/hxcpp to python, that would be fantastic as trying the haxe dot.path --python dot.path stuff im finding online is not working.

Also note, this is entirely for fun. Just something to save me some time prepping for dnd campaign. That being said, I happen to be okayish at programming and was hoping this wouldnt be too difficult and save time overall. If most of you think it would be easier just to learn haxe, maybe ill just do that or scrap the whole idea.

For reference the original: random city map generator

and the source code

1

There are 1 answers

0
CRobes On

Unfortunately, a game written with the lime/openfl engine can't be converted to Python, as the engine does not support Haxe's Python target: https://github.com/openfl/openfl#platforms

Also, the code generated by Haxe is not really meant to be human readable. Instead, you work on the code in Haxe, and then compile it to the target language (e.g. Python, JavaScript) as a compiled product, not really meant to be further modified by developers. So even if openfl supported Python, trying to edit the Python code generated by Haxe wouldn't be much fun as it's really messy, incomprehensible, and not generated for that purpose.

Hopefully that gives you a better idea of the purpose of Haxe. If you really want to use Python, there are a lot of Python game engines (pygame, ursina) which I'm sure also have open source projects online for you to play around with. Or you could stick with this and learn a bit of Haxe, who knows, maybe you'll like it and decide to stick around ;). Either way, enjoy the campaign!