CaptKiwi Posted October 21, 2013 Share Posted October 21, 2013 Hi Guys, There are the following commands : bullet.rotation = game.physics.moveToPointer(bullet, 300) sprite.rotation = game.physics.angleToPointer(sprite); I would rather have the bullet move to a particular sprite on the screen or angle to it, rather than going to the mouse pointer. Is there a similar command we can use like "move to sprite" or "angle to sprite" rather than moving to the pointer? Cheers! Link to comment Share on other sites More sharing options...
rich Posted October 22, 2013 Share Posted October 22, 2013 In dev branch: game.physics.moveToObject(displayObject, destination, speed, maxTime);Also you may find useful: moveToXY, accelerateToObject and accelerateToXY. Link to comment Share on other sites More sharing options...
CaptKiwi Posted October 22, 2013 Author Share Posted October 22, 2013 In dev branch: game.physics.moveToObject(displayObject, destination, speed, maxTime);Also you may find useful: moveToXY, accelerateToObject and accelerateToXY.Thank you rich. I was able to use "game.physics.moveToObject" and "angleBetween" to get the desired bullet movement effect :-) Link to comment Share on other sites More sharing options...
pinastroHTML5 Posted January 20, 2014 Share Posted January 20, 2014 can you give the example here Link to comment Share on other sites More sharing options...
Pixelguy Posted January 20, 2014 Share Posted January 20, 2014 You can see both "angleBetween" and "moveToObject" in the Tank example: http://gametest.mobi/phaser/examples/_site/view_full.html?d=games&f=tanks.js&t=tanks I hope it helps Nebulocity 1 Link to comment Share on other sites More sharing options...
Recommended Posts