EpicKingdom_

I completed my first Phaser Game, I would like to put it up on the Google Play store.

Recommended Posts

This is what my Phaser 2 game looks like in an Android emulator, I am not sure why. 

If I load a basic HTML5 docuiment with a simple h1 tag, it looks fine so it must be something wrong with my game. 

Capture.PNG

This is what it should look like. 

Screen Shot 2018-05-03 at 19.27.59.png

Share this post


Link to post
Share on other sites

this might be something related to CSP(Content Security Policy). When trying out cordova, I've faced issue where any of assets are not loading. It was solved by removing meta tag related to CSP. I'm not sure that's the best practice but it was okay for just get it to working condition. Other than that I didn't find any other issues. However I didn't run it on emulator, instead I run directly on the device and  also made apk and install on several other device and it was working good.

Maybe try running on actual device or build an apk?

I found this about CSP. I'm not sure this would solve your problem but it might be useful.

Share this post


Link to post
Share on other sites

This is what the Phaser 2 game looks like on my local Android device. 

(EDIT): I can scroll with my finger, it would appear that the game is too large for the device? Here are my settings. 
 

let game = new Phaser.Game(800, 720, Phaser.CANVAS);

game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
game.scale.pageAlignHorizontally = true;
game.scale.pageAlignVertically = true;



 

Screenshot_2018-05-06-20-23-52.png

Share this post


Link to post
Share on other sites
On 5/6/2018 at 1:39 PM, grinmonk said:

@EpicKingdom_ Have you tried scaling your game in a browser? I would recommend using Chrome's device emulation:

https://developers.google.com/web/tools/chrome-devtools/device-mode/

You might use this device mode to see how your game scales in different mobile devices. If it scales as you want in chrome-devtools than it should scale as it is on mobile device. If you want to disable scroll than you can use some meta tags in html. However I used phaser 3 and scale the game using custom JS function like this. Apart from that I don't have any experience with phaser2.

Share this post


Link to post
Share on other sites

I always use responsive web design in Firefox or Chrome when developing, the game scales in the browser. 
It just doesn't look right on an emulator or on my local device. Is Phaser not good for mobile development?

This is what it looks like in Chrome. 

(EDIT): I think I will just redesign the entire game to be 100% positive that it designed for mobile first.

 

Capture.PNG

Share this post


Link to post
Share on other sites

Alright, so I decided to just to just develop for the device I am aiming at (Nexus 5). 

So I set the canvas to 320px by 640px. 

Then I am using the Phaser scale methods. 

I also scaled all the sprites and text down and re-positioned them. 

This is the new result so far.

 

 

Screenshot_2018-05-07-20-44-38.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.