C# 클래스 MrGravity.Level

This class represents a level in the game
파일 보기 프로젝트 열기: DizWARE/Mr-Gravity 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
MCam Camera
MDeaths int
MNumCollectable int
MNumCollected int
MTimer double

공개 메소드들

메소드 설명
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

비공개 메소드들

메소드 설명
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

메소드 상세

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

Draw() 공개 메소드

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
리턴 void

Level() 공개 메소드

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
리턴 System

Load() 공개 메소드

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
리턴 void

Load() 공개 메소드

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
리턴 void

MainMenuLevel() 공개 정적인 메소드

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
리턴 Level

Reload() 공개 메소드

Reloads the content in this level
public Reload ( ) : void
리턴 void

Reset() 공개 메소드

Preps the level to reload content
public Reset ( ) : void
리턴 void

ResetAll() 공개 메소드

public ResetAll ( ) : void
리턴 void

ResetScores() 공개 메소드

Resets the Scores for this level to 0.
public ResetScores ( ) : void
리턴 void

Respawn() 공개 메소드

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

Update() 공개 메소드

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.
리턴 void

UpdateParticles() 공개 메소드

public UpdateParticles ( object sender, DoWorkEventArgs e ) : void
sender object
e System.ComponentModel.DoWorkEventArgs
리턴 void

UpdateStars() 공개 메소드

public UpdateStars ( ) : void
리턴 void

프로퍼티 상세

MCam 공개적으로 정적으로 프로퍼티

public static Camera,MrGravity MCam
리턴 Camera

MDeaths 공개적으로 정적으로 프로퍼티

public static int MDeaths
리턴 int

MNumCollectable 공개적으로 정적으로 프로퍼티

public static int MNumCollectable
리턴 int

MNumCollected 공개적으로 정적으로 프로퍼티

public static int MNumCollected
리턴 int

MTimer 공개적으로 프로퍼티

public double MTimer
리턴 double