C# Класс MrGravity.Game_Objects.GameObject

This represents an object that exists in the game
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Id int
MFriction float
MName String
MPosition Vector2
MPrevPos Vector2
MSpriteImageData Color[]
Velocity Vector2

Защищенные свойства (Protected)

Свойство Тип Описание
MCollisionType string
MIsSquare bool
MSize Vector2

Открытые методы

Метод Описание
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

Описание методов

Draw() публичный Метод

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
Результат void

Equals() публичный Метод

Checks to see if the other object is equal to this object
public Equals ( object obj ) : bool
obj object The other object
Результат bool

GameObject() публичный Метод

Initializes an empty GameObject.
public GameObject ( ) : System
Результат System

GameObject() публичный Метод

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
Результат System

GetHashCode() публичный Метод

Returns the Unique Object ID for this object. This should map the object in a "perfect" hashed, hash table
public GetHashCode ( ) : int
Результат int

Load() публичный Метод

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
Результат void

Respawn() публичный Метод

Resets this object to its initial position
public Respawn ( ) : void
Результат void

Описание свойств

Id публичное свойство

public int Id
Результат int

MCollisionType защищенное свойство

protected string MCollisionType
Результат string

MFriction публичное свойство

float that acts as a multiplier per frame 0.0f = 100% friction 1.0f = 0% friction
public float MFriction
Результат float

MIsSquare защищенное свойство

protected bool MIsSquare
Результат bool

MName публичное свойство

public String MName
Результат String

MPosition публичное свойство

public Vector2 MPosition
Результат Vector2

MPrevPos публичное свойство

public Vector2 MPrevPos
Результат Vector2

MSize защищенное свойство

protected Vector2 MSize
Результат Vector2

MSpriteImageData публичное свойство

public Color[] MSpriteImageData
Результат Color[]

Velocity публичное свойство

public Vector2 Velocity
Результат Vector2