C# Class Swordening.Wizard

Inheritance: Hero
Afficher le fichier Open project: ArghyV/Peliohjelmointi-s2011 Class Usage Examples

Méthodes publiques

Méthode Description
Cast1 ( GameTime gameTime ) : bool

checks if hero has enough mana to cast a fireball and if so then plays the sound and adds a fireball projectile.

RegenerateMana ( float amount = -1 ) : void

Regenerates mana.

Update ( GameTime gameTime ) : void

Allows the game component to update itself.

Wizard ( SwordeningGame game, InGame gameState, Vector3 position ) : System
checkDeath ( ) : void

Checks if hero has been slain and removes it from the game components.

increaseStats ( ) : void

When a level is gained hitpoints and and mana is increased. If hero dies at the same time when he gains a level, hero does not get max hitpoints back. The dead should stay dead.

killGain ( int exp, int money ) : void

this method is called whenever a monster dies. The hero gains exp and gold from the monster that died and calls for levelup method.

levelup ( ) : void

Checks if the hero has gained enough experience to gain a lvl and if so multiplies to next level by 2 so that the next level won't be reached as fast as the previous and also calls for increaseStats() method.

takeDmg ( int amount ) : void

Reduces hitpoints as given in the parametres. Calls checkDeath() after this.

Méthodes protégées

Méthode Description
LoadContent ( ) : void

Allows the game comopnent to load content from disk.

ProcessKeyboardInput ( GameTime gameTime ) : void

Reads and processes the input from the keyboard.

ProcessMouseInput ( GameTime gameTime ) : void

Reads and processes the input from the mouse.

Private Methods

Méthode Description
addProjectile ( ) : void

the direction of the fireball is taken from the mouse position in other words the projectile is launched towards the current mouse position

Method Details

Cast1() public méthode

checks if hero has enough mana to cast a fireball and if so then plays the sound and adds a fireball projectile.
public Cast1 ( GameTime gameTime ) : bool
gameTime Microsoft.Xna.Framework.GameTime
Résultat bool

LoadContent() protected méthode

Allows the game comopnent to load content from disk.
protected LoadContent ( ) : void
Résultat void

ProcessKeyboardInput() protected méthode

Reads and processes the input from the keyboard.
protected ProcessKeyboardInput ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Résultat void

ProcessMouseInput() protected méthode

Reads and processes the input from the mouse.
protected ProcessMouseInput ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Résultat void

RegenerateMana() public méthode

Regenerates mana.
public RegenerateMana ( float amount = -1 ) : void
amount float
Résultat void

Update() public méthode

Allows the game component to update itself.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime Provides a snapshot of timing values.
Résultat void

Wizard() public méthode

public Wizard ( SwordeningGame game, InGame gameState, Vector3 position ) : System
game SwordeningGame
gameState InGame
position Vector3
Résultat System

checkDeath() public méthode

Checks if hero has been slain and removes it from the game components.
public checkDeath ( ) : void
Résultat void

increaseStats() public méthode

When a level is gained hitpoints and and mana is increased. If hero dies at the same time when he gains a level, hero does not get max hitpoints back. The dead should stay dead.
public increaseStats ( ) : void
Résultat void

killGain() public méthode

this method is called whenever a monster dies. The hero gains exp and gold from the monster that died and calls for levelup method.
public killGain ( int exp, int money ) : void
exp int
money int
Résultat void

levelup() public méthode

Checks if the hero has gained enough experience to gain a lvl and if so multiplies to next level by 2 so that the next level won't be reached as fast as the previous and also calls for increaseStats() method.
public levelup ( ) : void
Résultat void

takeDmg() public méthode

Reduces hitpoints as given in the parametres. Calls checkDeath() after this.
public takeDmg ( int amount ) : void
amount int
Résultat void