BKremnev Posted April 12, 2014 Share Posted April 12, 2014 Hi, please take a look at this simple demo.Do you see how ball shakes? How to get rid of this? It's phaser 2.0.2 project.Thanks.reset.cssworld_camera.html Link to comment Share on other sites More sharing options...
Pedro Alpera Posted April 12, 2014 Share Posted April 12, 2014 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 More sharing options...
BKremnev Posted April 12, 2014 Author Share Posted April 12, 2014 Thanks, seems like this changes to code solve the issue Link to comment Share on other sites More sharing options...
Recommended Posts