Jump to content

adding property for the group


dudeperfect
 Share

Recommended Posts

I have a group of boosts, and I would like to add a property for all of them. I have a method, that creates individual item:

dropFruit: function() {
        var fruit = this.boosts.create(40, -10, 'apple');
        this.physics.enable(fruit);
        fruit.body.gravity.y = 40;
        fruit.collided = false;
    },
 
then I have collision method:
    collisionWithBoost: function(croc, boost) {
        this.score += 10;
        boost.collided = true;
    },
 
it doesn't recognize this, even that second argument(boost) is from the boosts group. Is it possible to do thing like I tried to?
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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