Finally My thoughts on the current state of html5.
Desktop html5 is powerful enough to be able to run most games as long as not to many effects with many sprites are being used. But the mobile performance for html5 is insanely bad and if that is something you want to support haxeflixel is not the right choice. Also with many things you will encounter with html5, importing js and using that code specific html5 libaries gives the best results in solutions with html5 specific problems so keep your eye out for those issues with browser display , showing video, saving cookies etc.
Also consider this: if the asset you're referencing with AssetPaths has been renamed or deleted, you will get a compiler error. If you reference the asset via a String path, you will only notice at runtime.
Thanks for your help ! What a great community ! :)
To show it on top, I removed and added it again. It works fine. It just seemed that it was not the right way to do it but ok.
By adding it again to the FlxMouseEventManager, it seems that I can click it correctly.
But I did it another way. I turned on the MouseChildren param so that I can trigger event on other objects overlapped by my gem. I did it since I need to be abble to trigger tooltips when the mouse is over buttons and I am draggind my gem.
Small update on this. The movement in general works great, only when the framerate drops even slightly then the jitter is noticeable. Eventually I've just dropped this game for this reason. It had a lot of custom physics which was very cool, but as soon as it gets too much, jitter happens.
I'm not a perfectionist, they always want a 10/10. I can settle for a 8/10, but it has to be a 8! :D. My game was about 50% done. I've tried putting the physics, along with demanding enemy AI on separate threads. But haxeflixel/openfl is not thread safe. With constantly using mutex to communicate between the threads, the performance gain was minimal.
This was an ambitious project. The physics + the AI where just too much, especially for phones. I've lost about 2 mounts on this, but hey, I had a lot of fun :D
I've started on a new game. One that does not need this much horsepower. Hopefully I can get it out in a couple of months.
You would need to convert all your shapes to paths for the best result and remove all effects or filters if there are any, as Lime doesn't support rendering for advanced shapes or filters and the like.
Hi I did try that :), The application does still run in the background, its just that the user won't see the application running unless they focus the application again.
x = 3. If the user clicks outside the application, and x = 6, they won't see the update of x = 6 until they focus the application again. There seems to be this jquery example that I could implement into the html5 myself, I guess I will give that a try. I don't have two computers ready to debug with me at the moment.
During development, sometimes i make mistakes myself by making a realignment callback when the game resizes. I usually build op an queue (List<>) of objects that needs to be realigned when that happens. Sometimes the order of execution is not correct and produces unwanted results. For example, usually my character is the most important object and needs to be realigned first, the other objects realign to the character. So if the objects get called before the character gets called, the objects will not update the the new cords. I solve these things by forcing the most important object to align first - usually the character. Perhaps you are dealing with a similar logic flaws?
Also I've found out that on Android the first alignment calls that have any good results, start on the second update() call. Everything prior to that can give unexpected results. This might have todo with adjusting screen orientation., but if i call my alignment prior to the second frame, then android will not align properly. Perhaps related to your problems?
Also Agustín Pérez Fernández idea/suggestion of making a custom scalemode or alternatively a custom camera is in general a really a good idea for your games. Try and build your games from the ground up with pleasing scale modes or cameras.
This might not be an answer, but maybe it inspires you. Otherwise please make some example code so we perhaps can take a look?
While I did figure something out, I still have a problem. The player tunnels through the terrain as well! This is what I'm doing. I create a map like in BSPMapGenerator. Then I sort of combine it with the SetTileProperties demo. I do it like this:
//When the flxtilemap is created from bspmapgenerator, i give it's tiles these properties
for (v in 1...16) map.setTileProperties(v, FlxObject.ANY, bombHit);
BombHit is just a rename of the function rightHit in SetTileProperties. I then set up everything else. For collisions, I go:
private function removeTile(Tile:FlxTile):Void
map.setTileByIndex(Tile.mapIndex, 0, true);
//Both here need to be FlxObject
private function bombHit(Tile:FlxObject, particle:FlxObject):Void
Again, the problem is tiles are set to 0 whenever the player object hits the tile map too. I've no idea how to fix that.
I need only the particles from the blue emitter to effect the tiles on the tile map and not the player object.
How would you do this?
Looks like your connection to HaxeFlixel was lost, please wait while we try to reconnect.