I'm trying to experiment with Sprite Kit's joint system. So far, I've had difficulty making even a single strand of "string"/"rope". The end goal is to produce something like a basketball net where there will be 1 left rope (vertical), 1 right rope (vertical) & at least 2 ropes in-between connecting the left & right rope (horizontally) - 4 ropes in total. Afterwards, figuring out how to make the 2 horizontal ropes not collide with an object (cannonball?) when it passes through them. Does anyone know how to do something like this? I've been trying this for 2 weeks and my eyes & fingers are sore.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- back button text does not change
- iOS (objective-c) compression_decode_buffer() retu
- how to find the index position of the ARRAY Where
相关文章
- 现在使用swift开发ios应用好还是swift?
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
- didBeginContact:(SKPhysicsContact *)contact not in
- Custom Marker performance iOS, crash with result “
- Why is my library not able to expand on the CocoaP
You can connect several physics bodies together with limit joints to create a rope like structure which is affected by collisions with other bodies. My code is quite messy but here is the Scene class for a sprite kit project. It has a basketball net and when you tap the screen it spawns a ball.
with screenshot here https://dl.dropboxusercontent.com/s/flixgbhfk2yysr8/screenshot.jpg?dl=0
EDIT: sorry about that, code is now in obj-C
EDIT: paste these methods into your SKScene subclass:
}
use
to add a basket
see new screenshot here: https://dl.dropboxusercontent.com/s/xe07ri70rgpxp47/screenshot%202.jpg?dl=0