Load script or compiled code at runtime


#1

我之前用cocos2d-js 制作了若干游戏,这些游戏可以热更文件…
现在我打算用openfl做游戏,openfl 可以实现类似cocos2d-js的功能吗?

translated english sentence :

I had created several games with cocos2d-js. these games can download javascript file that contains bufix…

now I want to make a game with openfl, and doest openfl has the ability to do the hotupdate like cocos2d-js do?


#2

Are you talking about mobile platforms?

OpenFL for native iOS and Android do not support patches without going through the App Store release process. You are not allowed to download and execute C++ binaries on Apple, only JavaScript. OpenFL for HTML5 could be wrapped in a mobile application using Phonegap or another wrapper, which would allow updates, but would affect performance since native code can perform 10x faster than JavaScript on mobile, in my tests


#3

Yes, I am talking about mobile platforms.
thank you for you reply!
Any plan to support patches?:grinning:


#4

You could do an HTML5 build, and put it into an application wrapper (such as PhoneGap or CocoonJS), though there would be a performance hit by doing so. That would enable you to release patches without an app store update


#5

I’m unsure about the current state of this project because i have never used it. Also i don’t know if it will suit your needs, but perhaps: HScript is a idea.

Other scenario’s might be to call Foreign Code and wrap a scripting engine like LUA. Then make a little engine in Haxe that supports the LUA code. That can work but may be a lot more then you would want to do.


#6

You are looking on how to cross script and load execution byte code? I have a good sample that they can communicate both ways for every platform except apple mobile devices.


#7

well.
I think I should continue to use cocos2d-js, this is only simple way to suit my need.
I really like openfl. and hate cocos2d-js for it bad api design and poor document…