Jump to content

Possible bug in accelerateToObject()?


frokenstein
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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