I have two image (image1 and image2). Image 2 is moving around the screen. I want to “do something” when image 2 is near (20pixels) of image1. How can I do this ?
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.
Create a frame that adds 20 pixel to each side of your image1’s frame:
Then just check if the frame of image2 collides with collisionFrame: