C# Класс 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.
Наследование: Entity
Показать файл Открыть проект

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

Свойство Тип Описание
timeToLive int
velocity Vector2

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

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

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

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

Draws the projectile.
public Draw ( SpriteBatch canvas ) : void
canvas Microsoft.Xna.Framework.Graphics.SpriteBatch The spritebatch onto which to draw the projectile.
Результат void

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

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

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

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

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

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

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

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

protected int timeToLive
Результат int

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

This is the velocity of the projectile. This class causes the projectile to move by this amount every Update cycle.
protected Vector2 velocity
Результат Vector2