C# Class MrGravity.Game_Objects.GameObject

This represents an object that exists in the game
Mostrar archivo Open project: DizWARE/Mr-Gravity Class Usage Examples

Public Properties

Property Type Description
Id int
MFriction float
MName String
MPosition Vector2
MPrevPos Vector2
MSpriteImageData Color[]
Velocity Vector2

Protected Properties

Property Type Description
MCollisionType string
MIsSquare bool
MSize Vector2

Public Methods

Method Description
Draw ( SpriteBatch canvas, GameTime gametime ) : void

Draws the object to the screen

Equals ( object obj ) : bool

Checks to see if the other object is equal to this object

GameObject ( ) : System

Initializes an empty GameObject.

GameObject ( Microsoft.Xna.Framework.Content.ContentManager content, float friction, EntityInfo entity ) : System

Constructs a GameObject

GetHashCode ( ) : int

Returns the Unique Object ID for this object. This should map the object in a "perfect" hashed, hash table

Load ( Microsoft.Xna.Framework.Content.ContentManager content, String name ) : void

Loads the visual representation of this character

Respawn ( ) : void

Resets this object to its initial position

Method Details

Draw() public method

Draws the object to the screen
public Draw ( SpriteBatch canvas, GameTime gametime ) : void
canvas Microsoft.Xna.Framework.Graphics.SpriteBatch Canvas that the game is being drawn on
gametime Microsoft.Xna.Framework.GameTime The current gametime
return void

Equals() public method

Checks to see if the other object is equal to this object
public Equals ( object obj ) : bool
obj object The other object
return bool

GameObject() public method

Initializes an empty GameObject.
public GameObject ( ) : System
return System

GameObject() public method

Constructs a GameObject
public GameObject ( Microsoft.Xna.Framework.Content.ContentManager content, float friction, EntityInfo entity ) : System
content Microsoft.Xna.Framework.Content.ContentManager The games content manager
friction float Friction that reacts to physics objects
entity MrGravity.Import_Code.EntityInfo
return System

GetHashCode() public method

Returns the Unique Object ID for this object. This should map the object in a "perfect" hashed, hash table
public GetHashCode ( ) : int
return int

Load() public method

Loads the visual representation of this character
public Load ( Microsoft.Xna.Framework.Content.ContentManager content, String name ) : void
content Microsoft.Xna.Framework.Content.ContentManager
name String
return void

Respawn() public method

Resets this object to its initial position
public Respawn ( ) : void
return void

Property Details

Id public_oe property

public int Id
return int

MCollisionType protected_oe property

protected string MCollisionType
return string

MFriction public_oe property

float that acts as a multiplier per frame 0.0f = 100% friction 1.0f = 0% friction
public float MFriction
return float

MIsSquare protected_oe property

protected bool MIsSquare
return bool

MName public_oe property

public String MName
return String

MPosition public_oe property

public Vector2 MPosition
return Vector2

MPrevPos public_oe property

public Vector2 MPrevPos
return Vector2

MSize protected_oe property

protected Vector2 MSize
return Vector2

MSpriteImageData public_oe property

public Color[] MSpriteImageData
return Color[]

Velocity public_oe property

public Vector2 Velocity
return Vector2