Jump to content

How to build Phaser game for mobile?


hydra
 Share

Recommended Posts

Hi,

 

I am mainly a web developer and Phaser got my attention with the idea of building mobile games with my current HTML5 and JS knowledge. I am very new to both Phaser and building mobile games, I'm self training over the phaser tutorials currently.

 

I think this may be the dumbest question ever to you guys but how do you build your phaser games into an iOS (ipa) or Android (apk) app? Do you use applications like PhoneGap? I just googled about building mobile apps and found PhoneGap, don't know what it is or how to use it but I will figure it out if it is the way to go. What do you use?

 

Thanks.

Link to comment
Share on other sites

i am currently developing a game targeting mobile devices..   until last week i used cocoonjs.

 

cocoonjs delivers a very good performance but you have to use canvas mode atm.   further you have to do custom hacks to use bitmap fonts, don't use the anchor method on texts, do a weird workaround for buttons where you display an invisible image at the end of your create function and so on.. also you can't get rid of the ludei splash screen...  the good thing..  it will run a game with 60fps where other methods achieve only 50-55 fps

(this depends of course of the game - i can only speak about my own experiences with two of my games and both run faster with cocoonjs than with any other method...)

 

 

then there is crosswalk:

 

crosswalk is using apache cordova (as phonegap) and builds on chromium (the base of chrome)

 

download the intel sdk, create a new project (just select the folder of your existing game) and then you can directly export as android crosswalk apk for example.. 

https://software.intel.com/de-de/html5/tools

also it's easy to debug your game with the app-preview app installed on your device.. you can connect your device to your pc and directly push your code to the device and test it with crosswalk.

 

it runs my games flawless, no problem or hacks at all..  i can use webgl and do not need a different version of my game for desktop or mobile..  

the downside:  not that fast ..  the same game on the same device runs at 55 fps instead of 60 fps

 

but.. with the new version of android and newer versions of crosswalk we can expect a huge performance boost.. so maybe it is the right horse to bet on :)

Link to comment
Share on other sites

Thank you all. I have done my research with your excellent suggestions and I started with Intel XDK, so far it seems nice with all the build options. I tried some simple tutorials with the Crosswalk build and they ran very smoothly on my device, except the ones that include particles. Very simple particle examples cripples the game, maybe I'm doing something wrong or writing some "bad-practice" code. This is a subject for another day, however ;)

 

Also Cordova seems easy enough if you need the interact with the device like sensors or writing to some file etc.. It is already implemented and ready to use in Intel XDK. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...