如何修复SKSpriteNode的跳跃高度,与Swift SpriteKit中的SKSpriteNode碰撞

时间:2016-01-07 08:48:54

标签: swift sprite-kit skspritenode

我正在使用applyImpluse进行修复跳转,但它采用动态跳跃高度,

   bird.physicsBody  =   SKPhysicsBody(circleOfRadius: bird.size.height / 2)
   bird.physicsBody?.dynamic   =   true
   bird.physicsBody?.friction              =   0.0
   bird.physicsBody?.restitution           =   0.0
   bird.physicsBody?.linearDamping         =   0.0
   bird.physicsBody?.affectedByGravity     =   true
   bird.physicsBody?.allowsRotation        =   false
   bird.physicsBody?.categoryBitMask       =   birdCategory
   bird.physicsBody?.contactTestBitMask    =   platformCategory 
   bird.physicsBody?.collisionBitMask      =   platformCategory 
   bird.physicsBody?.usesPreciseCollisionDetection = true
   bird.physicsBody?.applyImpulse(CGVectorMake(0, 15))

//我正在使用以下内容进行跳转

_bird.physicsBody?.applyImpulse(CGVectorMake(0,70.0))

0 个答案:

没有答案