I’m creating sprites and adding it to scene in loop in random places. I just want to check if newly created Sprite will cause collision with one of existing ones. Is there any simple way to check it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When you create a new sprite, add user data to it:
And then, after you created a positioned the sprite, before you add it iterate over the existing sprites:
The user data can be anything you want, it doesn’t have to be a string.