Jump to content

Object shaking when followed by camera


BKremnev
 Share

Recommended Posts

I think you have too much "scaling" going on in this example (stage, ball, etc). I have simplified the code and I tried this way (no scaling the ball and using crisp):

<!DOCTYPE html><html><head>	<title></title></head><script type="text/javascript" src="phaser.js"></script><script type="text/javascript">	var game = new Phaser.Game(320, 480, Phaser.AUTO,'', {preload: preload,  create: create, update: update});	function preload() {		// game.load.image('ball', 'phaser-dude.png');		game.load.image('ball', 'ChromeBall.png');		    // game.load.image('flyer', 'assets/sprites/phaser-dude.png');		game.load.image('earth', 'earth.png');	}		var backTile;	var ball;	function create() {		game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;		game.scale.minWidth = 320;		game.scale.minHeight = 480;		game.scale.pageAlignHorizontally = true;		game.scale.pageAlignVertically = true;		game.scale.forceOrientation(true, false);	    game.scale.setScreenSize(true);	    game.physics.startSystem(Phaser.Physics.ARCADE);	    backTile = game.add.tileSprite(0, 0, 1024, 1024, 'earth');	    ball = game.add.sprite(160, 240, 'ball');	    game.physics.enable(ball, Phaser.Physics.ARCADE);	    game.world.setBounds(0, 0, 1024, 1024);	   	ball.body.velocity.setTo(100, 100);	    ball.body.collideWorldBounds = true;	    ball.body.bounce.setTo(1);	       	ball.anchor.setTo(0.5, 0.5);	    game.stage.smoothed = false;	    game.camera.follow(ball);	}	function update() {	}</script><body></body></html>
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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