Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想让一个 SKSpriteNode 在屏幕没有被点击时开始下降(就像在飞扬的鸟中一样)。我有向上移动对象的 SKActions,在 touchesBegan 方法中调用它,我希望对象在下一次点击或它撞到地面之前下降。
尝试将您在游戏中的重力设置为 self.physicsWorld.gravity = CGVectorMake(0,-9.8); 并将您的 SKSpriteNode 设置为动态。
self.physicsWorld.gravity = CGVectorMake(0,-9.8);
test.physicsbody.dynamic = YES;