Jump to content

Move sprite towards another sprite


rtlehr
 Share

Recommended Posts

Thanks, that worked well.  This is what I ended up with

update: function()    {                    radians = game.physics.arcade.angleBetween(ufoSprite, humanSprite);                degrees = radians * (180/Math.PI);                        game.physics.arcade.velocityFromAngle(degrees, 300, ufoSprite.body.velocity);    }
Link to comment
Share on other sites

I saw the "moveToObject" in the docs, but it said that "The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course" and my "human" sprite is running from the UFO, so I did not think it would work.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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