rosanqod Posted July 13, 2013 Share Posted July 13, 2013 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"); } }})(); Link to comment Share on other sites More sharing options...
Recommended Posts