Contents

turbulenceField(withSmoothness:animationSpeed:)

Creates a field node that applies a randomized acceleration to physics bodies.

Declaration

class func turbulenceField(withSmoothness smoothness: CGFloat, animationSpeed speed: CGFloat) -> SKFieldNode

Parameters

  • smoothness:

    The smoothness of the noise used to generate the forces. This parameter should be a value between 0.0 and 1.0, where 1.0 represents a uniform smoothness.

  • speed:

    The speed at which the noise field should change. A value of 0.0 means that the field should not animate at all.

Return Value

A new turbulence field node.

Discussion

The acceleration’s magnitude is proportional to a body’s velocity.

See Also

Creating Field Nodes