ios - SKAction: how to generate a random delay in generation of nodes -
I use the following part of the code to generate SKNodes from time to time to make these encodes random There is a way to make a duration. In particular, how do I create "delayFish" in the following code, which can be an action with a random delay? ObjC: ago Set the average delay and range ... Swift: Set the average delay and range first ... And then change your delayFish action to ... < / P>
#define kAverageDelay 2.0 #define kDelayRange 1.0 // plus or minus 0.5 seconds varies depending on < P> And then change your delay on this action ...
SKAction * delayFish = [SKAction waitForDuration: kAverageDelay withRange: kDelayRange];
Average Avg Give: Range with TimeInterval = 2.0 delay: Time difference = 1.0 // Plus or minus varies with 0.5 seconds
delay file = SKAction.wait (forDuration: average middle, range: range)
Comments
Post a Comment