C# Class EtherDuels.Game.Model.SimplePhysicsAlgorithm

Defines a concrete physics algorithm. It provides methods to update the world objects' positions depending on a simple physics algorithm, which only contains gravity and the difficulty level.
Inheritance: Physics
Show file Open project: julius/pse_spacewar Class Usage Examples

Public Methods

Method Description
SimplePhysicsAlgorithm ( CollisionHandler collisionHandler, World world, ConfigurationRetriever configRetriever ) : System

Creates a new SimplePhysicsAlgorithm object.

Update ( GameTime gameTime ) : void

Updates gravity effects, calculates the new positions of all world objects and then reports all new collisions to the collisionHandler.

Private Methods

Method Description
GetCollisions ( ) : EtherDuels.Game.Model.WorldObject[][]
GetNewCollisions ( ) : EtherDuels.Game.Model.WorldObject[][]
UpdateDifficulty ( ) : void
UpdateExplosions ( GameTime gameTime ) : void
UpdateGravity ( GameTime gameTime ) : void
UpdatePositions ( GameTime gameTime ) : void

Method Details

SimplePhysicsAlgorithm() public method

Creates a new SimplePhysicsAlgorithm object.
public SimplePhysicsAlgorithm ( CollisionHandler collisionHandler, World world, ConfigurationRetriever configRetriever ) : System
collisionHandler CollisionHandler The assigned CollisionHandler which will be informed about collisions.
world World The assigned World whose objects are to be updated.
configRetriever ConfigurationRetriever
return System

Update() public method

Updates gravity effects, calculates the new positions of all world objects and then reports all new collisions to the collisionHandler.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The GameTime which contains how much time has passed since the last update.
return void