Jump to content

Create outside bounds


Faizy
 Share

Recommended Posts

Edit: found the solution, I had a callback when an enemie is out of bounds which killed it. Well, my question now is: is there a possible way to only check if the object is out of bounds on a specific site? Something like: 

enemy.events.onOutOfBoundsLeft.add(removeFromGroup, this);

 

Hey,

 

I want to create an enemy outside the worldbounds. The enemys position will get the velocity property:

enemy.body.velocity.x = -500;

 

so it will move from the right to the left. It all works fine, however I´m unable to create something like this(first parameter) and I think it´s due to the enemy would be outside the right bound.

this.enemy = game.add.sprite(game.width + 100, y, sprite)

 

Is there a solution to it?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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