deepnight / ldtk

Modern, lightweight and efficient 2D level editor
https://ldtk.io
MIT License
3.32k stars 181 forks source link

[SUGGESTION] Hot Reloading in Haxe #1017

Open chosencharacters opened 8 months ago

chosencharacters commented 8 months ago

I don't know if this is a limitation of Haxe macros, but there's been some investigation into hot reloading levels (especially with flixel) in LDTK. This would significantly cut down on dev time as it'd remove the need for constant recompiling to regen the macro. This is for situations where assets aren't embedded of course.

Could it be possible?

deepnight commented 7 months ago

Hot reloading should work in Haxe through the official LDtk Haxe importer. Here is an example from GameBase:

https://github.com/deepnight/gameBase/blob/79c70ea035d096c6282846b181997749ace67032/src/game/assets/Assets.hx#L60

what it does in short:

the idea should be the same in HF, but using their specific asset system