I’ve made 2 small games for the html5 target, the games are ready for release so I swtch to “Release” mode and the target to “HTML5 -final” in the FlashDevelop IDE. Then I make one final test and I see that the release mode breaks both games making them unplayable, the games work perfect building with debug mode and “HTML5 -final” as the target.
Also tested the release mode with the Flash target and works perfect as well. So the problem is with the Release mode in the HTML5 -final target.
This is very important for me since the Relase mode with the -final parameter makes the resulting JS file much smaller and loads much faster.
Here you can download the entire project of the 2 games ready to build, play and debug: https://drive.google.com/file/d/0B_E-kepEH1W_OE5fMXgzQWUyQ1k/view?usp=sharing
The problems caused by the Release mode are the following:
The “Sandwich” game click events doesn’t work.
The “Photoshop” game has a visual problem, see the screenshots.
Sandwich game:
I get a couple of errors in the JS console but I have no idea what function in the Haxe code maps to that error, the minification makes imposible to debug the code. Photoshop game:
There are no errors in the JS console.
Also I did a “Find And Replace In Files” searching for the word “Reflect” And my code is not using it except for some dead code, I deleted it and the problem is not fixed. Also noticed that openfl and swf libraries are using Reflect. So this is probably a problem in these librearies.
Can you download and check the project? because it seems this problem does not come from my code. There are OpenFL or SWF stuff that breaks on the minification.
Minification seems to be not very stable with Openfl.
Why so much reflection in the haxe platform? It’s a little frustrating because I built my classes olways avoiding reflection to not have this kind of problems and now I have them because all the other libraries use it.