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
Afficher le fichier Open project: julius/pse_spacewar Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

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
Résultat System

Update() public méthode

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.
Résultat void