jdiego82 Posted December 30, 2013 Share Posted December 30, 2013 Hey guys. I'm trying to get sprites in a group to scale to its -x equivalent when hitting the left and right world boundaries. The only implementation I've thought about is to assign each member to an index in an array, and use if's and forEach loops, but that seems a bit resource-intensive and dirty. Is there a way to use the game.physics.collide() function so I can do this in a cleaner way? Link to comment Share on other sites More sharing options...
rich Posted December 30, 2013 Share Posted December 30, 2013 There's no event specifically for this, so I would be tempted to create a left and right wall sprite and test for collision vs. that. Link to comment Share on other sites More sharing options...
jdiego82 Posted December 30, 2013 Author Share Posted December 30, 2013 There's no event specifically for this, so I would be tempted to create a left and right wall sprite and test for collision vs. that.Seems like a good workaround if there isn't an event yet. Thanks, rich. Link to comment Share on other sites More sharing options...
rich Posted December 30, 2013 Share Posted December 30, 2013 I probably won't add an event as such. It's more likely something that could be part of the Sprite.body - a callback or a boolean perhaps. Link to comment Share on other sites More sharing options...
Recommended Posts