Jump to content

Pause movement a sprite group


danbruegge
 Share

Recommended Posts

Hi everyone,

 

what is the simplest way to pause the movement of a sprite group?

 

When i try to pause with body.velocity.x/y it will work but when i resume, the sprite dont move again.

 

Explained on the tanks example, what will be the best solution? http://examples.phaser.io/_site/view_full.html?d=games&f=tanks.js&t=tanks

 

 

 

Dan

 

Link to comment
Share on other sites

If the sprites are moving via physics, doing sprite.body.enable = false will pause their movement, though setting it to true again may not continue to apply any latent forces correctly (i.e. an object decelerating due to drag may not continue to slow down predictably). Give it a go and see if it works as expected in your implementation.

Link to comment
Share on other sites

  • 3 years later...
 Share

  • Recently Browsing   0 members

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