I’m going through a tutorial but I don’t fully understand this piece of code. The method makes a group and stores some properties but I’m not really sure about how it iterates, especially the ‘child =>’ part.
Thanks
Steve
createStars()
{
const stars = this.physics.add.group({
key: STARS_KEY,
repeat: 11,
setXY: {x: 12, y: 0, stepX: 70}
})
stars.children.iterate((child) => {
child.setBounceY(Phaser.Math.FloatBetween(0.4, 0.8))
})
return stars
}