Jump to content

there is a delay in the animation


rosanqod
 Share

Recommended Posts

There is a delay when the animation is changing, is there something wrong? and how can i make no delay in the animation?
i'm using Phaser vesion 0.9.5
 

(function() {    var game = new Phaser.Game(this, 'game', 360, 360, init, create, update);    function init() {        game.loader.addSpriteSheet('bear', 'assets/chara1.png', 32, 32);        game.loader.load();    }    var bear;    function create() {        bear = game.createSprite(game.stage.centerX, game.stage.centerY, 'bear');        bear.animations.add('idle', [0]);        bear.animations.add('walk', [1, 0, 2, 0]);        bear.animations.add('jump', [1]);    }    function update() {        if(game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) {            bear.flipped = true;            bear.animations.play("walk", 6, true);        } else if(game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) {            bear.flipped = false;            bear.animations.play("walk", 6, true);        } else {            bear.animations.play("idle");        }    }})();

 

post-286-0-18982400-1373708537.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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