Jump to content

twening stops working after I add it to a physics system


Uibon
 Share

Recommended Posts

I am still pretty new to game development so I don't know if this is a bug or intended.

 

I created a group of enemies which are randomly placed and then tweened to move to a random location. It works fine if the code is like this: 

  enemies1 = game.add.group();  enemies1.createMultiple(10, 'enemy_red');  enemies1.setAll('checkWorldBounds', true);  enemies1.setAll('outOfBoundsKill', true);

But suddenly stops working the moment I add a physics system to the group.

  enemies1 = game.add.group();  enemies1.enableBody = true;  enemies1.physicsBodyType = Phaser.Physics.ARCADE;  enemies1.createMultiple(10, 'red');  enemies1.setAll('checkWorldBounds', true);  enemies1.setAll('outOfBoundsKill', true);

Any solutions? I need the collision detection so I can check if the enemy collides with the player.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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