Search the Community
Showing results for tags 'group sprite move update'.
Hello all. I just discovered Phaser.io and think it is great. I am a bit stuck, however, on how to manipulate members of a group. I have a space shooter where I spun up about a dozen enemies within a group. Now I want to select individual members of the groups to move toward the player in some pattern. I can't figure out how to get just one member of the group. I tried something like: var leader=enemies.getFirstAlive();leader.x-=1; but it did not work. Also, what if I wanted it to be a random enemy that was alive? Any guidance would be most appreciated.