Jump to content

Phaser animation


KnTproject
 Share

Recommended Posts

Hello,

Function create(){
dudes = game.add.group();
 dudes.enableBody = true;

       for (var i = -600; i < 600; i = i + 50){
        for (var y = -800; y < 800; y = y + 50){
        var dude = dudes.create(y,i,'dude');
        dude.frame = 4;
        dude.animations.add('left', [0,1,2,3],10,true);
        dude.animations.add('right',[5,6,7,8,],10,true);
        dude.animations.play('right');
        dude.body.velocity.x = +50;

 game.physics.arcade.enable(dudes);

}

This is my code. I would like to see all of the dudes the whole time. Now, they will disappear from the screen after a while. Which code do I have to write so that the code will repeat continuously?

If I have to write something in the function Update(), how do I have to call the dudes?

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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