C# Class SmashBros.Controllers.PowerUpController

Holds and controls all powerUps on map and drops powerups at random time at random position inside the dropZone
Inheritance: Controller
Datei anzeigen Open project: Grutn/TDT4240-X2 Class Usage Examples

Public Methods

Method Description
Load ( Microsoft.Xna.Framework.Content.ContentManager content ) : void
OnCollision ( Fixture powerUpGeom, Fixture character, Contact contant ) : bool

Runs when a character collides with a powerUp

OnNext ( GameStateManager value ) : void
PowerUpController ( ScreenManager screen, Box dropZone ) : System

Constructs the powerup controller

Unload ( ) : void
Update ( GameTime gameTime ) : void
addPowerUpToMap ( ) : void

Adds new random powerup to the map insise the drop zone

Private Methods

Method Description
RemovePowerUp ( int gotKilled ) : void
generateTimeToNext ( ) : void

Set random time until next powerUp is droped uses min and maxNew as upper & lower limitS

randomDropPosition ( ) : Vector2

Create and returns random position inside the dropZone

randomPowerUp ( ) : PowerUp

Returns random powerup from the list

Method Details

Load() public method

public Load ( Microsoft.Xna.Framework.Content.ContentManager content ) : void
content Microsoft.Xna.Framework.Content.ContentManager
return void

OnCollision() public method

Runs when a character collides with a powerUp
public OnCollision ( Fixture powerUpGeom, Fixture character, Contact contant ) : bool
powerUpGeom FarseerPhysics.Dynamics.Fixture
character FarseerPhysics.Dynamics.Fixture
contant FarseerPhysics.Dynamics.Contacts.Contact
return bool

OnNext() public method

public OnNext ( GameStateManager value ) : void
value GameStateManager
return void

PowerUpController() public method

Constructs the powerup controller
public PowerUpController ( ScreenManager screen, Box dropZone ) : System
screen SmashBros.MySystem.ScreenManager
dropZone Box dropZone for powerups
return System

Unload() public method

public Unload ( ) : void
return void

Update() public method

public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void

addPowerUpToMap() public method

Adds new random powerup to the map insise the drop zone
public addPowerUpToMap ( ) : void
return void