C# Class PantheonPrototype.Projectile

Contains all that is necessary to create a projectile in the game. May be used for bullets, fireballs, and maybe even eggs. When given an initial location and velocity, the projectile shall continue onwards unless told otherwise.
Inheritance: Entity
Exibir arquivo Open project: Bacon41/PantheonPrototype

Protected Properties

Property Type Description
timeToLive int
velocity Vector2

Public Methods

Method Description
Draw ( SpriteBatch canvas ) : void

Draws the projectile.

Load ( Microsoft.Xna.Framework.Content.ContentManager contentManager ) : void

Loads the projectile object.

Projectile ( Vector2 location, Rectangle drawBox, Rectangle boundingBox ) : System

A pass through constructor for the Entity class

Update ( GameTime gameTime, Pantheon gameReference ) : void

Updates the projectile each frame.

Method Details

Draw() public method

Draws the projectile.
public Draw ( SpriteBatch canvas ) : void
canvas Microsoft.Xna.Framework.Graphics.SpriteBatch The spritebatch onto which to draw the projectile.
return void

Load() public method

Loads the projectile object.
public Load ( Microsoft.Xna.Framework.Content.ContentManager contentManager ) : void
contentManager Microsoft.Xna.Framework.Content.ContentManager The content manager for loading resources.
return void

Projectile() public method

A pass through constructor for the Entity class
public Projectile ( Vector2 location, Rectangle drawBox, Rectangle boundingBox ) : System
location Vector2 The location of the entity relative to global space. Note that the reference point of the entity is the center of the bounding box.
drawBox Microsoft.Xna.Framework.Rectangle The box to which the sprite will be drawn. Only the width and height will be used.
boundingBox Microsoft.Xna.Framework.Rectangle The bounding box of the entity relative to the upper right hand corner of the entity.
return System

Update() public method

Updates the projectile each frame.
public Update ( GameTime gameTime, Pantheon gameReference ) : void
gameTime Microsoft.Xna.Framework.GameTime The amount of time since the last call of Update.
gameReference Pantheon A reference to the entire game.
return void

Property Details

timeToLive protected_oe property

protected int timeToLive
return int

velocity protected_oe property

This is the velocity of the projectile. This class causes the projectile to move by this amount every Update cycle.
protected Vector2 velocity
return Vector2