C# Class Nez.SpringGrid

grid of springs based on the tutorial: http://gamedevelopment.tutsplus.com/tutorials/make-a-neon-vector-shooter-for-ios-the-warping-grid--gamedev-14637
Inheritance: RenderableComponent, IUpdatable
Exibir arquivo Open project: prime31/Nez

Public Properties

Property Type Description
gridMajorColor Color
gridMajorPeriodX int
gridMajorPeriodY int
gridMajorThickness float
gridMinorColor Color
gridMinorThickness float

Public Methods

Method Description
SpringGrid ( Rectangle gridSize, Vector2 spacing ) : System.Collections.Generic
applyDirectedForce ( Vector2 force, Vector2 position, float radius ) : void

applies a force in a 3-dimensional direction

applyDirectedForce ( Vector3 force, Vector3 position, float radius ) : void

applies a force in a 3-dimensional direction

applyExplosiveForce ( float force, Vector2 position, float radius ) : void

applies a force the pushes the grid out aware from the point

applyExplosiveForce ( float force, Vector3 position, float radius ) : void

applies a force the pushes the grid out aware from the point

applyImplosiveForce ( float force, Vector2 position, float radius ) : void

applies a force that sucks the grid in towards the point

applyImplosiveForce ( float force, Vector3 position, float radius ) : void

applies a force that sucks the grid in towards the point

render ( Graphics graphics, Camera camera ) : void

Private Methods

Method Description
IUpdatable ( ) : void
drawLine ( Batcher batcher, Vector2 start, Vector2 end, Color color, float thickness = 2f ) : void
projectToVector2 ( Vector3 v ) : Vector2

Method Details

SpringGrid() public method

public SpringGrid ( Rectangle gridSize, Vector2 spacing ) : System.Collections.Generic
gridSize Microsoft.Xna.Framework.Rectangle
spacing Vector2
return System.Collections.Generic

applyDirectedForce() public method

applies a force in a 3-dimensional direction
public applyDirectedForce ( Vector2 force, Vector2 position, float radius ) : void
force Vector2 Force.
position Vector2 Position.
radius float Radius.
return void

applyDirectedForce() public method

applies a force in a 3-dimensional direction
public applyDirectedForce ( Vector3 force, Vector3 position, float radius ) : void
force Vector3 Force.
position Vector3 Position.
radius float Radius.
return void

applyExplosiveForce() public method

applies a force the pushes the grid out aware from the point
public applyExplosiveForce ( float force, Vector2 position, float radius ) : void
force float Force.
position Vector2 Position.
radius float Radius.
return void

applyExplosiveForce() public method

applies a force the pushes the grid out aware from the point
public applyExplosiveForce ( float force, Vector3 position, float radius ) : void
force float Force.
position Vector3 Position.
radius float Radius.
return void

applyImplosiveForce() public method

applies a force that sucks the grid in towards the point
public applyImplosiveForce ( float force, Vector2 position, float radius ) : void
force float Force.
position Vector2 Position.
radius float Radius.
return void

applyImplosiveForce() public method

applies a force that sucks the grid in towards the point
public applyImplosiveForce ( float force, Vector3 position, float radius ) : void
force float Force.
position Vector3 Position.
radius float Radius.
return void

render() public method

public render ( Graphics graphics, Camera camera ) : void
graphics Graphics
camera Camera
return void

Property Details

gridMajorColor public_oe property

color of all major grid lines
public Color gridMajorColor
return Color

gridMajorPeriodX public_oe property

how often a major grid line should appear on the x axis
public int gridMajorPeriodX
return int

gridMajorPeriodY public_oe property

how often a major grid line should appear on the y axis
public int gridMajorPeriodY
return int

gridMajorThickness public_oe property

thickness of all major grid lines
public float gridMajorThickness
return float

gridMinorColor public_oe property

color of all minor grid lines
public Color gridMinorColor
return Color

gridMinorThickness public_oe property

thickness of all minor grid lines
public float gridMinorThickness
return float