1

I want to make a game which needs to drag an object (UIView class object) and intersect with an another object (UIButton) and the same time an event generates , and checks the matching of object is right or wrong.

If wrong the objects come back to its position.

The touch and drag I have done with the object but elasticity of the objects position is not working properly ? Any example or help Please

Aravindhan
  • 15,608
  • 10
  • 56
  • 71
  • 1
    You're too vague. What doesn't work? The drag, or the return to position? Have you looked at CoreAnimation? Need more info. – Owen Hartnett Jul 05 '12 at 13:19
  • Yeh i used core animation and touch and move methods but still the animation of dragging the object not working properly, may be my lack of knowledge in COCOA animation.. – user1073831 Jul 10 '12 at 12:07
  • Actually I am looking for something as a tile on the ipad screen that is situated on the particular coordinates, while dragging and touching if we leave it it just come back to it's position with elasticity animation – user1073831 Jul 10 '12 at 12:09

1 Answers1

0

If you're using standard (non-GL) programming, you can use the object's frame to check if the objects intersect. There's a call for it. You can take the relevant points of one object and check if they are inside the other object's polygon. If they are, then you have a collision. The Quartz 2D drawing tools have lots of intersection methods for these types of objects.

Owen Hartnett
  • 5,925
  • 2
  • 19
  • 35