Jump to content

Issue with group


Recommended Posts

I'm having a issue with the group elements; I'm trying to remove them all or kill them and it won't work, it doesn't even trigger an error on console. I don't know if i'm forgetting something, but if anyone can help i will be really glad. 

This is my shortened code:

create: function () {    this.choices = game.add.group();},displayChoices: function(index) {    for(var i = 0; i < 3; i++){       this.choice = this.choices.create(130, 110, 'choice');       this.choice = game.add.text(130, 140, game.global.script[index].choice);       this.choice.inputEnabled = true;       this.choice.events.onInputDown.add(this.choiceTest, this);    }},choiceTest: function(clicked) {    this.choices.callAll('kill');    //this.choices.removeAll();}

I want to kill all the 'choice' created when the choiceTest() is triggered, i tried both methods but neither worked, if i am overlooking something i apologize in advance lol




Link to comment
Share on other sites


  • Recently Browsing   0 members

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