C# Class MrGravity.Level

This class represents a level in the game
Afficher le fichier Open project: DizWARE/Mr-Gravity Class Usage Examples

Méthodes publiques

Свойство Type Description
MCam Camera
MDeaths int
MNumCollectable int
MNumCollected int
MTimer double

Méthodes publiques

Méthode Description
Dispose ( ) : void
Draw ( SpriteBatch spriteBatch, GameTime gameTime, Matrix scale ) : void

Draws the level background on to the screen

Level ( String filepath, IControlScheme controls, Viewport viewport ) : System

Initializes a new instance of the Level class.

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

Loads the level from the content manager

Load ( Microsoft.Xna.Framework.Content.ContentManager content, string assetName ) : void

Loads the level from the content manager

MainMenuLevel ( string filepath, IControlScheme controls, Viewport viewport, Rectangle region ) : Level
Reload ( ) : void

Reloads the content in this level

Reset ( ) : void

Preps the level to reload content

ResetAll ( ) : void
ResetScores ( ) : void

Resets the Scores for this level to 0.

Respawn ( ) : void

Respawn the player. Reset gravity direction and clear player velocity TODO - Reset all other objects as well

Update ( GameTime gameTime, GameStates &gameState ) : void

Updates the level's progress

UpdateParticles ( object sender, DoWorkEventArgs e ) : void
UpdateStars ( ) : void

Private Methods

Méthode Description
GetAnimation ( string name ) : AnimatedSprite

Returns the proper animation for the given tile

HandleCollisions ( PhysicsObject physObj, GameStates &gameState ) : void

Checks to see if given object is colliding with any other object and handles the collision

PrepareCollisionMatrix ( ) : void

Prepares the collision matrix in the game

RemoveFromMatrix ( GameObject obj ) : void

Removes the object from the matrix(for collectables

UpdateCollisionMatrix ( GameObject obj, Vector2 oldPosition ) : void

Updates the collision matrix with the new position

Method Details

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Draw() public méthode

Draws the level background on to the screen
public Draw ( SpriteBatch spriteBatch, GameTime gameTime, Matrix scale ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch Sprite batch that we use to draw textures
gameTime Microsoft.Xna.Framework.GameTime
scale Matrix
Résultat void

Level() public méthode

Initializes a new instance of the Level class.
public Level ( String filepath, IControlScheme controls, Viewport viewport ) : System
filepath String
controls IControlScheme The controls scheme
viewport Microsoft.Xna.Framework.Graphics.Viewport The viewport for the cameras
Résultat System

Load() public méthode

Loads the level from the content manager
public Load ( Microsoft.Xna.Framework.Content.ContentManager content ) : void
content Microsoft.Xna.Framework.Content.ContentManager Content Manager to load from
Résultat void

Load() public méthode

Loads the level from the content manager
public Load ( Microsoft.Xna.Framework.Content.ContentManager content, string assetName ) : void
content Microsoft.Xna.Framework.Content.ContentManager Content Manager to load from
assetName string
Résultat void

MainMenuLevel() public static méthode

public static MainMenuLevel ( string filepath, IControlScheme controls, Viewport viewport, Rectangle region ) : Level
filepath string
controls IControlScheme
viewport Microsoft.Xna.Framework.Graphics.Viewport
region Microsoft.Xna.Framework.Rectangle
Résultat Level

Reload() public méthode

Reloads the content in this level
public Reload ( ) : void
Résultat void

Reset() public méthode

Preps the level to reload content
public Reset ( ) : void
Résultat void

ResetAll() public méthode

public ResetAll ( ) : void
Résultat void

ResetScores() public méthode

Resets the Scores for this level to 0.
public ResetScores ( ) : void
Résultat void

Respawn() public méthode

Respawn the player. Reset gravity direction and clear player velocity TODO - Reset all other objects as well
public Respawn ( ) : void
Résultat void

Update() public méthode

Updates the level's progress
public Update ( GameTime gameTime, GameStates &gameState ) : void
gameTime Microsoft.Xna.Framework.GameTime The game time.
gameState GameStates State of the game.
Résultat void

UpdateParticles() public méthode

public UpdateParticles ( object sender, DoWorkEventArgs e ) : void
sender object
e System.ComponentModel.DoWorkEventArgs
Résultat void

UpdateStars() public méthode

public UpdateStars ( ) : void
Résultat void

Property Details

MCam public_oe static_oe property

public static Camera,MrGravity MCam
Résultat Camera

MDeaths public_oe static_oe property

public static int MDeaths
Résultat int

MNumCollectable public_oe static_oe property

public static int MNumCollectable
Résultat int

MNumCollected public_oe static_oe property

public static int MNumCollected
Résultat int

MTimer public_oe property

public double MTimer
Résultat double