Jump to content

Phaser and new camera type - Help to last adjust


PRSoluções
 Share

Recommended Posts

Hi,

I made a new camera follow mode, because none of existing type is what i want. I dont know if it is a great feature to Phaser lib, but to me is what i want.

The only problem in my update calc, is a flick when my sprite is moving.

This is my code on game update (the camera default follow code is disabled):

game.camera.x = Math.round(this.player.sprite.x - (game.camera.width / 2));
game.camera.y = Math.round(this.player.sprite.y - (game.camera.height / 2));
game.camera.bounds = new Phaser.Rectangle(this.player.sprite.x + (game.camera.width / 2), this.player.sprite.y + (game.camera.height / 2), , );

Can anyone have any tips?Screenshot 2016-03-30 01.59.34.png

 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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