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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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