C# Class Platformer.Levels.DynamicMap

A Map which holds a number of levels and can switch between them. It also holds the player instance.
Inheritance: IDisposable
Show file Open project: zmthy/play-dead Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void

Will unload all of the loaded content.

Draw ( GameTime gameTime, SpriteBatch spriteBatch ) : void

Draws the player and the currently active level to the screen.

DynamicMap ( IServiceProvider serviceProvider, Camera2D camera, GraphicsDevice gd ) : System
GotoLevel ( int levelIndex ) : void
LoadStory ( string storyPath ) : void

Load a story and create all of the levels listed in the file by using the LevelFactory.

NextLevel ( String levelName ) : void
Update ( GameTime gameTime, KeyboardState keyboardState, GamePadState gamePadState, TouchCollection touchState, Microsoft.Xna.Framework.Input.AccelerometerState accelState, DisplayOrientation orientation, InputManager inputManager ) : void

Update the Player state, the tracking camera, and the currently active level.

Method Details

Dispose() public method

Will unload all of the loaded content.
public Dispose ( ) : void
return void

Draw() public method

Draws the player and the currently active level to the screen.
public Draw ( GameTime gameTime, SpriteBatch spriteBatch ) : void
gameTime Microsoft.Xna.Framework.GameTime
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
return void

DynamicMap() public method

public DynamicMap ( IServiceProvider serviceProvider, Camera2D camera, GraphicsDevice gd ) : System
serviceProvider IServiceProvider
camera Platformer.Camera.Camera2D
gd GraphicsDevice
return System

GotoLevel() public method

public GotoLevel ( int levelIndex ) : void
levelIndex int
return void

LoadStory() public method

Load a story and create all of the levels listed in the file by using the LevelFactory.
public LoadStory ( string storyPath ) : void
storyPath string The filepath of the story file.
return void

NextLevel() public method

public NextLevel ( String levelName ) : void
levelName String
return void

Update() public method

Update the Player state, the tracking camera, and the currently active level.
public Update ( GameTime gameTime, KeyboardState keyboardState, GamePadState gamePadState, TouchCollection touchState, Microsoft.Xna.Framework.Input.AccelerometerState accelState, DisplayOrientation orientation, InputManager inputManager ) : void
gameTime Microsoft.Xna.Framework.GameTime The current time step of the game.
keyboardState Microsoft.Xna.Framework.Input.KeyboardState The current state of the PC keyboard.
gamePadState Microsoft.Xna.Framework.Input.GamePadState
touchState TouchCollection
accelState Microsoft.Xna.Framework.Input.AccelerometerState
orientation DisplayOrientation
inputManager InputManager
return void