Nikow Posted May 15, 2015 Share Posted May 15, 2015 Hi, I've in my game a group with many of asteroids and my shoots are created in a class , how can i make them collides ? Thank you , Link to comment Share on other sites More sharing options...
phuurup Posted May 16, 2015 Share Posted May 16, 2015 (edited) I think what you're looking for is: this.physics.arcade.collide( this.myShoots, this.asteroids); //put this in your update function (will differ if you're using stages/states) and then you'll have to define the 'myShoots' function and the "asteroids" function just bellow your update function, before your closing }; . I hope this is what you were looking for! Play around with your code. it seems like it's 10% "coding" 90% debugging haha.. lol my bad: this.physics.arcade.collide( this.myShoots, this.asteroids); //this will make them collide this.physics.arcade.overlap( this.myShoots, this.asteroids, this.die, null, this); //so this says when the shot and the astroid collide execute the third parameter "die". don't forget to make the functions! Edited May 16, 2015 by phuurup Link to comment Share on other sites More sharing options...
Recommended Posts