Jump to content

Adding animations to custom group objects.


metalNumb
 Share

Recommended Posts

Hey all.

 

So i have been trying to add some animations to my sprite objects in a group, they appear with velocity as expected, 

but they won't animate ( and there're no errors ).   :huh:

 

Here's what i mean.

create(){            enemies = this.add.group();            enemies.enableBody = true;            enemies.physicsBodyType = Phaser.Physics.ARCADE;            enemies.setAll('outOfBoundsKill', true);            enemies.setAll('checkWorldBounds', true);function spawnEnemy (){              var enemy = new Enemy (this,'enemy',this.world.width - 50,                            Math.random() * (this.world.height/2),pixos, ship, floating);                        enemies.add(enemy);                        this.add.existing(enemy);              enemy.body.velocity.x = Math.random()*(-speedMax+speedMin) - speedMin ;} // SPAWN enemies.callAll('animations.add', 'animations', 'move',[0,1,2,3] ,10, true);enemies.callAll('animations.play', 'animations', 'move');enemyTimer = this.game.time.create(false);enemyTimer.loop(1000, spawnEnemy, this);enemyTimer.start();} // CREATE

Please help ?

Thanks !

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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