Jump to content

Possible bug in accelerateToObject()?


Recommended Posts

I have a game where the world bounds extend far beyond the screen. I have a sprite set to accelerateToObject() to another sprite. This accelerating sprite is set like so:

this.checkWorldBounds = true;this.outOfBoundsKill = true;

What I am seeing is really strange. Because the sprite accelerates, it can sometimes fly offscreen. This was anticipated, and isn't an issue. But what I see is when the sprite flies offscreen to the top or the left, it is killed even if it is not outside the world bounds. Even stranger, when it flies off to the right or the bottom, even if it does go outside the world bounds, it does not get killed. Has anyone seen behavior like this?


The world is 16000 x 16000. The sprite retracks its target every time update() is called, like so:

this.bullets.forEach(function (bullet) {this.game.physics.arcade.accelerateToObject(bullet, this.player, 1000, 1000, 1000);}, this);
Link to comment
Share on other sites


  • Recently Browsing   0 members

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