C# 클래스 Swordening.Wizard

상속: Hero
파일 보기 프로젝트 열기: ArghyV/Peliohjelmointi-s2011 1 사용 예제들

공개 메소드들

메소드 설명
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.

보호된 메소드들

메소드 설명
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.

비공개 메소드들

메소드 설명
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

메소드 상세

Cast1() 공개 메소드

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
리턴 bool

LoadContent() 보호된 메소드

Allows the game comopnent to load content from disk.
protected LoadContent ( ) : void
리턴 void

ProcessKeyboardInput() 보호된 메소드

Reads and processes the input from the keyboard.
protected ProcessKeyboardInput ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
리턴 void

ProcessMouseInput() 보호된 메소드

Reads and processes the input from the mouse.
protected ProcessMouseInput ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
리턴 void

RegenerateMana() 공개 메소드

Regenerates mana.
public RegenerateMana ( float amount = -1 ) : void
amount float
리턴 void

Update() 공개 메소드

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

Wizard() 공개 메소드

public Wizard ( SwordeningGame game, InGame gameState, Vector3 position ) : System
game SwordeningGame
gameState InGame
position Vector3
리턴 System

checkDeath() 공개 메소드

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

increaseStats() 공개 메소드

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
리턴 void

killGain() 공개 메소드

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
리턴 void

levelup() 공개 메소드

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
리턴 void

takeDmg() 공개 메소드

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