AlexArroyoDuque Posted February 23, 2014 Share Posted February 23, 2014 Hello. I have seen several posts that talk about this topic. I do not understand what happens when the bullets hit platforms. Function when the collision occurs is not executed. This only happens when the bullet hits a group of platforms. This is my codecreate: this.bullets = this.game.add.group(); this.bullets.createMultiple(30, 'bullet'); this.bullets.forEach(utils.setupBullet, this); utils.setupBullet = function(bullet) { bullet.anchor.x = 0.5; bullet.anchor.y = 0.5; bullet.outOfBoundsKill = true; bullet.lifespan = 2300; bullet.body.setCircle(15); bullet.animations.add('default', [0, 1, 2, 1], 10, true); bullet.animations.play('default'); }; update: this.game.physics.overlap(this.bullets, this.layer, this.collisionBulletWall, null, this); collisionBulletWall: function(bullet, wall) { bullet.kill(); } any idea? Link to comment Share on other sites More sharing options...
Recommended Posts