Jump to content

since phaser 2.3 Arcade collision not working (group vs group && Sprite vs Sprite)


Sam
 Share

Recommended Posts

I'm getting stuck with this issue. I've updated my projects from phaser 2.2 to current 2.3.0. and every collision isn't working any more. I'm using the arcade.physics system. Set up is (shortened): the collision handler does not fire.

Group 1this.wave = this.add.group();this.wave.enableBody = true;this.wave.physicsBodyType = Phaser.Physics.ARCADE;game.physics.enable(this.wave, Phaser.Physics.ARCADE);Group 2this.player = this.add.group();this.player.enableBody = true;this.player.physicsBodyType = Phaser.Physics.ARCADE;game.physics.enable(this.player, Phaser.Physics.ARCADE);into update func:game.physics.arcade.collide( this.player, this.wave, this.collision, null, this);does not detect anything.Same goes with sprite vs. sprite, worked before.I tried different configurations since there are multiple ways and I do not know which one is actually the most updated:wave_obj.physicsBodyType = Phaser.Physics.ARCADE;game.physics.enable(wave_obj, Phaser.Physics.ARCADE);this.game.physics.arcade.enable(wave_obj);game.physics.arcade.enable( wave_obj );console output contains: type: 0 and physicsType: 0 - is that correct?c.Sprite {type: 0, physicsType: 0, position: c.Point, scale: c.Point, transformCallback: null…}

Any ideas? suggestions, I've tried every syntax written above. with phaser 2.2 it worked. 
also tried:

game.physics.startSystem(Phaser.Physics.ARCADE);game.physics.arcade.TOP_BOTTOM;with sprite vs spritegame.physics.enable( [ this.racer, wave_obj ], Phaser.Physics.ARCADE);game.physics.arcade.overlap instead of game.physics.arcade.collide

regards

 

Link to comment
Share on other sites

Found the problem, but I wonder that it worked before: this.wave.addChildAt( wave_obj, i_counter );
I just rewrote it to this.wave.add( wave_obj ); <- sprite gets added to group.

this.wave.addChildAt( wave_obj, i_counter ); Does not work but adds the sprites to the group successfully..
so this may be something to fix, or I even misunderstood the usage?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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