C# Class MrGravity.Game_Objects.Physics_Objects.Player

Represents the player in the game
Inheritance: PhysicsObject
Datei anzeigen Open project: DizWARE/Mr-Gravity Class Usage Examples

Public Properties

Property Type Description
MCurrentTexture Microsoft.Xna.Framework.Graphics.Texture2D
MIsAlive bool
MNumLives int

Public Methods

Method Description
CheckForIdle ( ) : Microsoft.Xna.Framework.Graphics.Texture2D

Checks to see if the player is idle if it is, change his face

Draw ( SpriteBatch canvas, GameTime gametime ) : void

Draw the player, with rotation due to gravity taken into affect

IsFaceStraight ( ) : bool

Checks to see if the face is straight

Kill ( ) : int

Handle players death

Player ( Microsoft.Xna.Framework.Content.ContentManager content, PhysicsEnvironment &environment, IControlScheme controlScheme, float friction, EntityInfo entity ) : System

Construcs a player object, that can live in a physical realm

ResetIdle ( int mTimer, GravityDirections mDirection ) : void
Respawn ( ) : void
Rumble ( double time, GameTime gameTime ) : void

Sets the controller to rumble for the amount of time passed

SetFaceStraight ( ) : void

Sets the player face to straight

StartRumble ( ) : void

Starts controller rumble

StopRumble ( ) : void

Stop controller rumble

ToString ( ) : string

Gets the Unique identifier for this object. Will be used for logging

Update ( GameTime gametime ) : void

Updates the player location and the player controls

Method Details

CheckForIdle() public method

Checks to see if the player is idle if it is, change his face
public CheckForIdle ( ) : Microsoft.Xna.Framework.Graphics.Texture2D
return Microsoft.Xna.Framework.Graphics.Texture2D

Draw() public method

Draw the player, with rotation due to gravity taken into affect
public Draw ( SpriteBatch canvas, GameTime gametime ) : void
canvas Microsoft.Xna.Framework.Graphics.SpriteBatch Canvas SpriteBatch
gametime Microsoft.Xna.Framework.GameTime Current gametime
return void

IsFaceStraight() public method

Checks to see if the face is straight
public IsFaceStraight ( ) : bool
return bool

Kill() public method

Handle players death
public Kill ( ) : int
return int

Player() public method

Construcs a player object, that can live in a physical realm
public Player ( Microsoft.Xna.Framework.Content.ContentManager content, PhysicsEnvironment &environment, IControlScheme controlScheme, float friction, EntityInfo entity ) : System
content Microsoft.Xna.Framework.Content.ContentManager Content manager for the game
environment PhysicsEnvironment
controlScheme IControlScheme Controller scheme for the player(Controller or keyboard)
friction float
entity MrGravity.Import_Code.EntityInfo
return System

ResetIdle() public method

public ResetIdle ( int mTimer, GravityDirections mDirection ) : void
mTimer int
mDirection GravityDirections
return void

Respawn() public method

public Respawn ( ) : void
return void

Rumble() public method

Sets the controller to rumble for the amount of time passed
public Rumble ( double time, GameTime gameTime ) : void
time double The amount of time to rumble
gameTime Microsoft.Xna.Framework.GameTime The current gameTime
return void

SetFaceStraight() public method

Sets the player face to straight
public SetFaceStraight ( ) : void
return void

StartRumble() public method

Starts controller rumble
public StartRumble ( ) : void
return void

StopRumble() public method

Stop controller rumble
public StopRumble ( ) : void
return void

ToString() public method

Gets the Unique identifier for this object. Will be used for logging
public ToString ( ) : string
return string

Update() public method

Updates the player location and the player controls
public Update ( GameTime gametime ) : void
gametime Microsoft.Xna.Framework.GameTime The current Gametime
return void

Property Details

MCurrentTexture public_oe property

public Texture2D,Microsoft.Xna.Framework.Graphics MCurrentTexture
return Microsoft.Xna.Framework.Graphics.Texture2D

MIsAlive public_oe property

public bool MIsAlive
return bool

MNumLives public_oe property

public int MNumLives
return int