boland Posted October 15, 2014 Share Posted October 15, 2014 I'm new to PixiJS. What I'm trying to do is add a bunch of Sprites at random locations. I managed that and it's working.However, I don't want images to overlap. Of course I can do a check every time I want to add an image and see if it collides with any image by looping through all children, and randomize the location again if it's colliding, but that is not really efficient.I'm not sure what the best approach would be. I could store somehow all pixel locations that have been occupied and when I detect a collision, shift up/left/right/down until I find a free spot? Is that the best approach? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.