Jump to content

Collison 1 out of 15


Recommended Posts

Hi im having a problem where only one out of my 15 sprites in my group are colliding and I dont know how to fix this. 

collisionDetection: function(){

        this.game.physics.arcade.collide(this.player, enemy);

//when they are being created

                 for(var i = 0; i< this.ENEMY_SERVICE_POOL; i++){
                        enemy = new TGA.RunClasses.Enemy(this.game, {
                        x:-20 + Math.random() * 500,
                        enemy.checkWorldBounds = true;
                        enemy.outOfBoundsKill = true;


Idk why this happens. :l

Link to comment
Share on other sites

It's not about performance but the functionality you want to achieve. You can do the collisions manually with every single enemy, or do it a lot easier with the Phaser's built in functionality with groups - from the game's point of view you're doing exactly the same.

Link to comment
Share on other sites


  • Recently Browsing   0 members

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