Tengo un grupo de estrellas. Me da solo 1 estrella al principio. Quiero lograrlo, si tomo esta estrella, me da 2 estrellas, si tomo 2 estrellas, me da 3, y así sucesivamente. ¿Cómo puedo hacerlo?
stars = this.physics.add.group({ key: 'star', repeat: -1, setXY: { x: Phaser.Math.RND.between(0, 900), y: Phaser.Math.RND.between(0, 600), frameQuantity: 2, repeat: 5 } }); this.physics.add.overlap(player, stars, collectStar, null, this); function collectStar (player,star){ star.disableBody(true, true); score += 2; // COUNT BY 2 scoreText.setText('Score: ' + score); }