我有一个应用程序,我正在应用一个物理机构的impuluse。
它在模拟器中完美运行,当应用程序安装在设备上时,它无法正常工作,这意味着脉冲未正确应用。
这种行为可能是什么原因?我试图从模拟器中删除该应用程序并再次安装它。它在模拟器中完美运行。
请指教。感谢。
ball1.size = CGSizeMake(siz/2,siz/2)
ball1.position = CGPointMake(self.frame.size.width/2,self.frame.size.height/2 + (sizy*4))
ball1.physicsBody = SKPhysicsBody(circleOfRadius: siz/4)
ball1.physicsBody?.categoryBitMask = UInt32(ballmask)
ball1.physicsBody?.contactTestBitMask = UInt32(bodymask) | UInt32(brickmask) | UInt32(barmask) | UInt32(bordermask)
ball1.physicsBody?.collisionBitMask = UInt32(bodymask) | UInt32(brickmask) | UInt32(barmask) | UInt32(bordermask)
ball1.physicsBody?.restitution = 1.0
ball1.physicsBody?.friction = 0.0
ball1.physicsBody?.linearDamping = 0.0
ball1.physicsBody?.usesPreciseCollisionDetection = true
ball1.physicsBody?.affectedByGravity = false