Objective c 触摸“开始”仅在精灵套件中执行一次速度

Objective c 触摸“开始”仅在精灵套件中执行一次速度,objective-c,touch,sprite,Objective C,Touch,Sprite,我只想触摸精灵一次以执行速度,而不是在触摸后再执行速度 -(SKSpriteNode *)createBallWithLocation:(CGPoint)position { _d =[SKSpriteNode spriteNodeWithImageNamed:@"d"]; _d.position=position; _d.physicsBody=[SKPhysicsBody bodyWithRectangleOfSize:_d.size]; _d.phys

我只想触摸精灵一次以执行速度,而不是在触摸后再执行速度

-(SKSpriteNode *)createBallWithLocation:(CGPoint)position  {
    _d =[SKSpriteNode spriteNodeWithImageNamed:@"d"];

    _d.position=position;
    _d.physicsBody=[SKPhysicsBody bodyWithRectangleOfSize:_d.size];

    _d.physicsBody.velocity = velocity; 


 -(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
 }

请在代码前面使用4个字符将其格式化正确您的详细意思是什么请我需要为sprite执行一次速度仅我使用self.userinteraction=NO;但是场景中的其他对象对触摸没有反应我指的是你帖子的格式。代码前面需要4个空格才能正确显示。我刚刚做了一个编辑。请记住这一点,以便下次发布。对不起,我无法回答这个问题。