Jump to content

Unexpected collision using createMultiple


Recommended Posts

Hi gamers!


I have a group in which some coins are created with createMultiple.

When I start the game the player collisions with unexpected group of coins ... 

The score of the player increases, therefore the collision occurs, but is not physically collide ...


Some code:

            this.coinlGroup = this.game.add.group();

            this.coinGroup.createMultiple(70, 'coin');

            this.coinGroup.forEach(setupCoinGroup, this);




Link to comment
Share on other sites



This is my setup function:


setupCoinGroup = function (coin, theGame) {
    coin.body.data.gravityScale = 0.25;
    coin.anchor.setTo(0.5, 0.5);
    coin.body.collides(theGame.playerCG); // ¿problem?
    coin.body.mass = 0.01;
    coin.alpha = 0.8;
Link to comment
Share on other sites


  • Recently Browsing   0 members

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