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
Mostrar archivo Open project: mahmoudbahaa/XNA-Game-project Class Usage Examples

Public Methods

Method 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

Method 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 method

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

FirstAidManager() public method

public FirstAidManager ( MyGame game ) : System
game MyGame
return System

Update() public method

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

checkCollisionWithBullet() public method

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
return bool