How to create custom SKActions?

Hi everyone, what I want to do is create an SKAction that does something similar to a wheelRight.physicsBody.velocity = CGVectorMake(0, 1000);physical object.

+4
source share
1 answer

Use the SKAction runBlock:method:

SKAction *changeVelocity = [SKAction runBlock:^{
        wheelRight.physicsBody.velocity = CGVectorMake(0, 1000);
    }];
SKAction sequence = [SKAction sequence:@[..., changeVelocity, ..., ...]];
[wheelRight runAction:sequence];
+4
source

Source: https://habr.com/ru/post/1524026/


All Articles