Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Phaser Camera follow not working in iPhone ONLY


JesusJoseph
 Share

Recommended Posts

Hi All, Thanks for reading my post.
I am creating an isometric platform game with map bigger than the phone's screen.
So I use Camera.follow with my player sprite (a taxi) to move around the map.
The code is perfectly working in Android tablet but in iPhone (latest IOS) the map is not moving down (bigger side) but its moving to the right side.
Please see the demo (Both android and iPhone) in this youtube link.https://youtu.be/yZ14Vuodeu0

Please see my code below

I set the Bounds bigger than the current game size

me.game.world.setBounds(0, 0, 2000, 1200);
// me.game.physics.startSystem(Phaser.Physics.ARCADE);
me.game.physics.startSystem(Phaser.Physics.P2JS);
game.add.plugin(Phaser.Plugin.Debug)

This is the camera.follow code

    me.taxiNE = me.game.add.sprite(370, 130, 'CityRide', 'taxi_NE');
    // me.game.camera.follow(me.taxiNE);
    me.game.camera.follow(me.taxiNE, Phaser.Camera.FOLLOW_LOCKON, 0.1, 0.1);
    me.taxiNE.anchor.set(0.5);
    me.game.physics.enable(me.taxiNE, Phaser.Physics.ARCADE);

This is my update function which has the taxi move code.

update: function() {
	var me = this;
	if (!me.gameOver && me.game.input.activePointer.isDown && game.physics.arcade.distanceToPointer(me.taxiNE, game.input.activePointer) > 8) {
		game.physics.arcade.moveToPointer(me.taxiNE, 200);
	} else {
		me.taxiNE.body.velocity.set(0);
	}
	me.game.physics.arcade.overlap(me.taxiNE, me.wrongLocation, me.hitTheRoad);
},

 

I am working on this for last 2 days and i can't fix this issue.
Can someone please give me some idea how to fix this.

PS: I am not sure whether this is some know issue (either in phaser 2.5 or latest iOS)

 

Link to comment
Share on other sites

On 7/2/2016 at 8:40 AM, bruno_ said:

How are you running your game?

Through chrome and safari or cordova, cocoon?

Try to test different browsers, may be a compatibility issue.

1

I am running the game from iPhone 6 plus with latest IOS (upgraded last week).

I build it using Cordova.

its working perfectly in android tablet, and chrome browser

Still not able to fix it.

Any suggestions will be highly appreciated. 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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