Jump to content

Tween Problem duplicate image


i3Designer
 Share

Recommended Posts


create: function(){  

        this.creaNemici();

    },


 

 

creaNemici: function(){

        

        this.nemico = game.add.sprite(-100,20,'nemico');

        this.nemico.anchor.setTo(0.5,0.5);

        game.physics.enable(this.nemico, Phaser.Physics.ARCADE);

   },

 


update: function(){

        

        game.add.tween(this.nemico).to( { x:game.world.centerX,y:game.world.centerY }, 1300,Phaser.Easing.Linear.None, true);

 

},

 

I have a problem with the tween. I create an image and want it follows the position of an image. To test I set that the enemy has to go in the center of the world, I have done as above by removing the piece of code that was not interested. But I start, the game show two images.

 

PS: In localhost I see two pictures, but if I do the screenshot, you can not see. is the render?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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