C# Class MoodSwingCoreComponents.MS2DCollidable

MS2DCollidable is an MS2DComponent that has a Shape that can be used for switch-casing collision detection.
Inheritance: MS2DComponent
Show file Open project: verngutz/MoodSwing Class Usage Examples

Protected Properties

Property Type Description
collisionTexture Texture2D
shape Shape

Public Methods

Method Description
CollidesWith ( MS2DCollidable other ) : bool

Check if this MS2DCollidable collides with another MS2DCollidable.

EnclosesPoint ( Point p ) : bool

Check whether Point p is within the bounds of this MS2DCollidable

MS2DCollidable ( Rectangle boundingRectangle, Shape shape, SpriteBatch spriteBatch, Game game ) : System
MS2DCollidable ( Vector2 position, Vector2 size, Shape shape, SpriteBatch spriteBatch, Game game ) : System

Method Details

CollidesWith() public method

Check if this MS2DCollidable collides with another MS2DCollidable.
public CollidesWith ( MS2DCollidable other ) : bool
other MS2DCollidable the other MS2DCollidable
return bool

EnclosesPoint() public method

Check whether Point p is within the bounds of this MS2DCollidable
public EnclosesPoint ( Point p ) : bool
p Point the Point to check
return bool

MS2DCollidable() public method

public MS2DCollidable ( Rectangle boundingRectangle, Shape shape, SpriteBatch spriteBatch, Game game ) : System
boundingRectangle Rectangle
shape Shape
spriteBatch SpriteBatch
game Game
return System

MS2DCollidable() public method

public MS2DCollidable ( Vector2 position, Vector2 size, Shape shape, SpriteBatch spriteBatch, Game game ) : System
position Vector2
size Vector2
shape Shape
spriteBatch SpriteBatch
game Game
return System

Property Details

collisionTexture protected property

protected Texture2D collisionTexture
return Texture2D

shape protected property

protected Shape shape
return Shape