C# Class MyGame.FirstAidManager

This class represent the First aid manager that manages creating first aids and calling updates on them, also removing first aid and adding health to player at collision detected.
Inheritance: Microsoft.Xna.Framework.DrawableGameComponent
Afficher le fichier Open project: mahmoudbahaa/XNA-Game-project Class Usage Examples

Méthodes publiques

Méthode Description
Draw ( GameTime gameTime ) : void

This method renders the current state.

FirstAidManager ( MyGame game ) : System
Update ( GameTime gameTime ) : void

Allows the component to run logic.

checkCollisionWithBullet ( Unit unit ) : bool

if the unit(player or bullet) collide with the first aid add the health

Private Methods

Méthode Description
addFirstAidKit ( ) : void

Add a new medkit at a random location on the terrain

addHealth ( int j ) : void

add health specified by difficult constants to the health of the player and remove the mdekit

Method Details

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

FirstAidManager() public méthode

public FirstAidManager ( MyGame game ) : System
game MyGame
Résultat System

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

checkCollisionWithBullet() public méthode

if the unit(player or bullet) collide with the first aid add the health
public checkCollisionWithBullet ( Unit unit ) : bool
unit Unit Unit to check collision with
Résultat bool