C# Class ThreadedPlatformer.Gem

A valuable item the player can collect.
显示文件 Open project: sq/Fracture Class Usage Examples

Public Properties

Property Type Description
Color Color

Public Methods

Method Description
Draw ( GameTime gameTime, BitmapBatch batch ) : void

Draws a gem in the appropriate color.

Gem ( Level level, Vector2 position ) : System

Constructs a new gem.

LoadContent ( ) : void

Loads the gem texture and collected sound.

OnCollected ( Player collectedBy ) : void

Called when this gem has been collected by a player and removed from the level.

Update ( GameTime gameTime ) : void

Bounces up and down in the air to entice players to collect them.

Method Details

Draw() public method

Draws a gem in the appropriate color.
public Draw ( GameTime gameTime, BitmapBatch batch ) : void
gameTime Microsoft.Xna.Framework.GameTime
batch BitmapBatch
return void

Gem() public method

Constructs a new gem.
public Gem ( Level level, Vector2 position ) : System
level Level
position Vector2
return System

LoadContent() public method

Loads the gem texture and collected sound.
public LoadContent ( ) : void
return void

OnCollected() public method

Called when this gem has been collected by a player and removed from the level.
public OnCollected ( Player collectedBy ) : void
collectedBy Player /// The player who collected this gem. Although currently not used, this parameter would be /// useful for creating special powerup gems. For example, a gem could make the player invincible. ///
return void

Update() public method

Bounces up and down in the air to entice players to collect them.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void

Property Details

Color public_oe property

public Color Color
return Color