DudeshootMankill Posted December 22, 2016 Share Posted December 22, 2016 Hey guys, i'm making a sidescroller with phaser and tiled. I've run into some problems with the gun function. I collide my bullet group like this. this.game.physics.arcade.collide(this.bullet, this._collision_layer, this._kill_bullet, null, this); and the function goes like this: _kill_bullet(bullet, _collision_layer) { bullet.kill(); } this._collision_layer is a tilemap. Now the bullets collide and destroy pretty well, when fired at a low rate of fire. But when i ramp out the speed and rate of fire, the bullets start passing through the collision layer. Especially at angles. If i try to check for overlap instead, the bullet is destroyed instantly. I believe this is because the bounding box encapsulates all of the tilemaplayer. Does anyone have any insights they could share with me here? Some pointers possibly? Link to comment Share on other sites More sharing options...
DudeshootMankill Posted December 23, 2016 Author Share Posted December 23, 2016 I figured this out on my own. What i did was this: this.physics.arcade.overlap(this.bullets, this._collision_layer, function (bullet, _collision_layer) { bullet.kill(); }, function (particle, _collision_layer) { return _collision_layer.collides; }, this); Following this article https://github.com/hexus/phaser-arcade-slopes/issues/7 Link to comment Share on other sites More sharing options...
Recommended Posts