Several questions about HTML5 development
Agustín Pérez Fernández
For HTML5 game I've been using phaser because it solves some things in an easier way and It seems to work faster on that platform alone.
The problem with phaser is that it is slower for mobile native games so I want to go back to use Flixel to develop games. I made this Phaser demo with all the basic features I need on an HTML5 Game: https://github.com/Tembac/ChimangoGamesDemo
I would love to reproduce the same demo using Flixel. I have several questions about HTML5 things that I solved using phaser but I'm not sure how to do them on HaxeFlixel:
How does the server work? Every time I compile the game opens on http://localhost:2000/ but I'm not sure what server it is using. I would love to be able to set up some things for the server.
Can I setup a local server that allows me to enter from different devices than the development machine? This is useful for mobile testing. I tried opening the local host from other devices but doesn't work. On phaser I'm using Budo for the server that allows me to enter from other devices using the ip address of the development machine.
How can I detect if the device was rotated?
How can I detect the device of the user to know if it is desktop or mobile?
SWF support works really bad. I hope this improves with the new OpenFl. Is there any date for the new openfl support for HaxeFlixel?
How is the correct way to use audio assets? On Phaser, I made several audioSprites on several formats for each browser compatibility. Does HaxeFlixel support audio sprites? What is the best format for audio?
I hope to get answers here because there is not a lot of documentation about HTML5 development with HaxeFlixel and it is one of the most important platforms for our studio right now.
To host your HTML5 on a local server:
- Go to your html5 bin folder which has the .html
- Open the Command Prompt there (Shift + Right Click > Open the command window here)
- Type in
- Hit Enter
Options: -h [domain] - set hostname -p [port] - set port -d [directory] - set base directory -log [file] - set log file -rewrite - activate pseudo mod-rewrite for smart urls
That's the first two questions.
And to answer the 4th: to detect if a user is on desktop or a phone, you will want to use FlxG.onMobile. It's been added a while ago but I guess it was not publicly noticed.
Agustín Pérez Fernández
Thanks for the answers!
I'm not able to enter to the server from devices on the same network. How can I solve that?
This should help.
I have this problem myself sometimes, randomly for no reason. It just could not access but after a while it could.