Sprite Kit - containsPoint for SKPhysicsBody?
Posted
by
gj15987
on Game Development
See other posts from Game Development
or by gj15987
Published on 2014-05-28T11:54:04Z
Indexed on
2014/05/28
16:01 UTC
Read the original article
Hit count: 573
ios
|sprite-kit
I have a ball bouncing around the screen. I can pick it up and drag it onto a "bucket".
When my touches finish, I use the containsPoint function to check and see if I have dropped the ball onto the bucket.
This works fine, however, I actually want to check whether the ball is dropped onto the bucket node's physics body because my "bucket" is actually just an oval, and so I've applied a physics body which is the same shape as the oval, so that the white space around the oval isn't included in the physics simulation.
I can't seem to find a "containsPoint" function for physics bodies. Can anyone advise on how I'd check for this?
To summarise, I want to drop a node, onto a specific part of another node (or its physics body) and trigger an event.
Thanks in advance.
© Game Development or respective owner