As they say, in Phaser.js how you can apply an action to each object within a group. I want to apply the following lines to each element:
game.physics.arcade.collide(something, platforms);
game.physics.arcade.overlap(player, something, gameOver, null, this);
something.body.velocity.x = -120;
“Something” is the name of the object, but my group name is called “obstruction”. I want to do this because I have another function that constantly creates new objects for the group, so I don’t necessarily know that they are called.
source
share