Boxtufty Posted March 30, 2014 Share Posted March 30, 2014 Hi,I'm trying to do exactly this: http://examples.phaser.io/_site/view_full.html?d=arcade%20physics&f=accelerate+to+pointer.js&t=accelerate%20to%20pointer I want to achieve this with two sprites instead of one sprite and 'moveToPointer'. Can anyone help? ;_; Link to comment Share on other sites More sharing options...
Martiny Posted March 30, 2014 Share Posted March 30, 2014 I did this, see if it solves your problem:function create() { sprite1 = game.add.sprite(200, 200, 'sprite1'); sprite2 = game.add.sprite(100, 100, 'sprite2'); game.physics.enable(sprite1, Phaser.Physics.ARCADE);}function update() { game.physics.arcade.accelerateToObject(sprite1, sprite2);}Here there is the documentation, there is more ways to accelerate a sprite, such as accelerateToXY. http://docs.phaser.io/Phaser.Physics.Arcade.html#accelerateToObject (: Link to comment Share on other sites More sharing options...
Boxtufty Posted March 30, 2014 Author Share Posted March 30, 2014 Thanks that's exactly what I wanted. I will learn to read the docs now, promise Link to comment Share on other sites More sharing options...
Recommended Posts