C# Class MyGame.BulletsManager

This class represent the bullet manager that manages creating and calling updates on bullets, also removing bullet at collision detected.
Inheritance: Microsoft.Xna.Framework.DrawableGameComponent, IEvent
Afficher le fichier Open project: mahmoudbahaa/XNA-Game-project Class Usage Examples

Protected Properties

Свойство Type Description
events List

Méthodes publiques

Méthode Description
AddBullet ( Vector3 position, Vector3 rotation, Vector3 direction ) : void

Add a new bullet at the specified position, rotation and direction

BulletsManager ( MyGame game ) : System

Constructor that initialize the bullet manager

Draw ( GameTime gameTime ) : void

This method renders the current state.

Update ( GameTime gameTime ) : void

Allows the component to run logic.

addEvent ( Event ev ) : void

Add event to the event queue

Méthodes protégées

Méthode Description
FireShots ( ) : void

Fire a new bullet if the specified event(C_ATTACK_BULLET_END) was received

UpdateShots ( GameTime gameTime ) : void

update the bullet if the bulltet out of range or collide with the monster remove it

Method Details

AddBullet() public méthode

Add a new bullet at the specified position, rotation and direction
public AddBullet ( Vector3 position, Vector3 rotation, Vector3 direction ) : void
position Vector3 initial position of the new bullet
rotation Vector3 rotation of the new bullet
direction Vector3 Direction in which the bullet will move
Résultat void

BulletsManager() public méthode

Constructor that initialize the bullet manager
public BulletsManager ( MyGame game ) : System
game MyGame Instance of MyGame this game component is attached to
Résultat System

Draw() public méthode

This method renders the current state.
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The elapsed game time.
Résultat void

FireShots() protected méthode

Fire a new bullet if the specified event(C_ATTACK_BULLET_END) was received
protected FireShots ( ) : void
Résultat void

Update() public méthode

Allows the component to run logic.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The gametime.
Résultat void

UpdateShots() protected méthode

update the bullet if the bulltet out of range or collide with the monster remove it
protected UpdateShots ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The game time
Résultat void

addEvent() public méthode

Add event to the event queue
public addEvent ( Event ev ) : void
ev Event Event to be added
Résultat void

Property Details

events protected_oe property

protected List events
Résultat List