C# Class TraceRacer.PlayerObject

This is the player game component.
Inheritance: Microsoft.Xna.Framework.DrawableGameComponent
Show file Open project: alexcoco/trace_racer Class Usage Examples

Public Properties

Property Type Description
Position Vector2
Speed Vector2
airtime int
gameOver bool

Public Methods

Method Description
Draw ( GameTime gameTime ) : void

Draws the player on the screen.

Initialize ( ) : void

Allows the game component to perform any initialization it needs to before starting to run. This is where it can query for any required services and load content.

PlayerObject ( Microsoft.Xna.Framework.Game game, SpriteBatch givenSpriteBatch, WorldObject world ) : System

Constructor initializes everything.

Update ( GameTime gameTime ) : void

Allows the game component to update itself.

setActive ( ) : void
setPosition ( Vector2 v ) : void

Private Methods

Method Description
adjustSpeed ( int difference ) : void

Method Details

Draw() public method

Draws the player on the screen.
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void

Initialize() public method

Allows the game component to perform any initialization it needs to before starting to run. This is where it can query for any required services and load content.
public Initialize ( ) : void
return void

PlayerObject() public method

Constructor initializes everything.
public PlayerObject ( Microsoft.Xna.Framework.Game game, SpriteBatch givenSpriteBatch, WorldObject world ) : System
game Microsoft.Xna.Framework.Game
givenSpriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
world WorldObject
return System

Update() public method

Allows the game component to update itself.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime Provides a snapshot of timing values.
return void

setActive() public method

public setActive ( ) : void
return void

setPosition() public method

public setPosition ( Vector2 v ) : void
v Vector2
return void

Property Details

Position public property

public Vector2 Position
return Vector2

Speed public property

public Vector2 Speed
return Vector2

airtime public property

public int airtime
return int

gameOver public property

public bool gameOver
return bool