Jump to content

Sprite Accelerate to Sprite


Recommended Posts

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.





Link to comment
Share on other sites


  • Recently Browsing   0 members

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