0
用力我有一些像這樣:如何在碰撞中的iOS迅速使用精靈套件
func didBeginContact(contact: SKPhysicsContact) {
var paddle = getPaddleFromContact(contact) //of type SKPhysicsBody
var ball = getBallFromContact(contact) //of type SKPhysicsBody
if(paddle != nil && ball != nil){
//apply force to ball depending on the speed/velocity of the paddle
//NEED HELP WITH THIS LOGIC
}
}
目前的用戶能夠使用觸摸拖動槳。它只能移動水平。我不確定哪個屬性或如何根據槳的速度確定施加多大的力。有關如何正確執行此操作的任何建議?
我嘗試使用paddle.velocity但這些都只是0的
目前正在對類似的東西我自己