I used an English translator.
For example, in c++, you can access the elements you want by int a[10]; a[5]=0. But I’m not sure what to do in Phaser 3 typescript. I want to put five objects in an array and manage the desired object.
code:
LifeGroup = this.add.group();
for (let i = 0; i < 5; i++) {
let ifeGroup = this.add.image(60 * (i + 1), 60, "HP");
ifeGroup.setActive(false);
ifeGroup.setVisible(false);
this.LifeGroup.add(ifeGroup);
}
LifeGroup[3].setActive(true);