bondreal Posted May 11, 2017 Share Posted May 11, 2017 I was looking around at the tutorials and the examples and I did not see anything about how to access via the game object or some other object a collection of the added sprites. I am new to Phaser so I might have missed it. I also searched the forums but I did not see anything. However, if you all know where a thread is or how do to it I would really appreciate a nudge in the right direction. Link to comment Share on other sites More sharing options...
samme Posted May 11, 2017 Share Posted May 11, 2017 For finding one sprite/object, there is Group#getAt(index), Group#getByName(name), or just Group#children[index]. For iteration there is Group#forEach() and Group#children. The game world (game.world) is also a Group so it has these methods too. But typically you would organize sprites in groups so you don't have to guess about where they are. See phaser-ce/Phaser.Group. Link to comment Share on other sites More sharing options...
bondreal Posted May 11, 2017 Author Share Posted May 11, 2017 Thanks Samme. I had glossed right over the group method. I appreciate the assist. I will do my best to pay it forward. Link to comment Share on other sites More sharing options...
Recommended Posts