Skip to main content

CCLightningTrack

CCLightningTrack

Cocos2D

Inheritance: System.Object

Constructors

CCLightningTrack(CCPoint, CCPoint)

CCLightningTrack(CCPoint, CCPoint)(Cocos2D.CCPoint start, Cocos2D.CCPoint end)
Parameters:
start (Cocos2D.CCPoint)
end (Cocos2D.CCPoint)

Properties

Sway(System.Single)

This determines how much each segment of the lightning strike will deviate from its past neighbor. The value range is [1,+inf). The jaggedness of the bolt is inversely proportional to the sway.

Track(System.Collections.Generic.ListCocos2D.CCPoint)

Returns the computed segment track of the lightning bolt.

Methods

CreateBolt(CCPoint, CCPoint)

System.Collections.Generic.ListCocos2D.CCPoint CreateBolt(CCPoint, CCPoint)(Cocos2D.CCPoint source, Cocos2D.CCPoint dest)

Creates the full set of bolt segments between the start and end points. Based upon the algorithm found at http://gamedevelopment.tutsplus.com/tutorials/how-to-generate-shockingly-good-2d-lightning-effects--gamedev-2681 by Michael Hoffman.

Parameters:
source (Cocos2D.CCPoint)
dest (Cocos2D.CCPoint)
Returns:
System.Collections.Generic.ListCocos2D.CCPoint
Example

GetPoint(float)

Cocos2D.CCPoint GetPoint(float)(System.Single position)
Parameters:
position (System.Single)
Returns:
Cocos2D.CCPoint