C# 클래스 MrGravity.WorldSelect

Level selection menu that allows you to pick the level to start
파일 보기 프로젝트 열기: DizWARE/Mr-Gravity 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
LevelDirectory string

공개 메소드들

메소드 설명
CheckForSave ( ) : bool

Checks if a save file for the game already exists - and loads it if so. Meant to be used solely on XBOX360. Should be used as soon as we know what PlayerIndex the "gamer" is using (IE right after the title screen). Note: if a save game does not exist the constructor for this class should have filled in the default values (0 stars, all but the first locked - on xbox our default xml file should always have the default values - we cannot save information to that file as it is a binary xnb file that can't be changed at run time) Do not call this until we know the PlayerIndex the player is using!

Draw ( SpriteBatch spriteBatch, Matrix scale ) : void

Draws the menu on the screen

GetLevelCollect ( ) : int
GetLevelDeath ( ) : int
GetLevelTime ( ) : int
Load ( Microsoft.Xna.Framework.Content.ContentManager content ) : void

Loads all the content needed for the levels

Reset ( ) : void

Resets the world system

Save ( ) : void

Saves level unlock and scoring information PC saving is straightforward - but xDoc.Save() will not work on xbox360. Instead we use the built in XmlSerializer class to serialize an element out to an xml file. We build our Xelement like normal - but instead of saving that directly using XDocument.Save() we place this XElement into a struct, and use XmlSerializer to serialize the data out into a storage device on the xbox.

UnlockWorld ( int world ) : void

Unlocks the given world

Update ( GameTime gameTime, GameStates &gameState, Level &currentLevel ) : void

Handle any changes while on the level selection menu

UpdateStarCount ( ) : void

Updates the star count.

WorldSelect ( IControlScheme controlScheme, GraphicsDeviceManager graphics ) : System

Constructs the menu screen that allows the player to select a level

비공개 메소드들

메소드 설명
CreateRegions ( ) : void

Creates all the regions for the level editor for easy placement within the Title Safe area

DrawInfoBar ( SpriteBatch spriteBatch, int shiftValue ) : void

Draw info bar on the right

DrawLevelPanel ( SpriteBatch spriteBatch ) : void

Draws the levels in each of its panels

DrawTitleBar ( SpriteBatch spriteBatch ) : void

Draw the title bar to the screen

Exit ( GameStates &gameState ) : void

Exits the level selection

HandleAKey ( GameStates &gameState, Level &currentLevel ) : void

Handles when the A key is pressed

HandleBKey ( GameStates &gameState ) : void

Handles when user presses the back key

HandleDirectionKey ( ) : void

Handles the directional keys

SelectDevice ( IAsyncResult result ) : void

메소드 상세

CheckForSave() 공개 메소드

Checks if a save file for the game already exists - and loads it if so. Meant to be used solely on XBOX360. Should be used as soon as we know what PlayerIndex the "gamer" is using (IE right after the title screen). Note: if a save game does not exist the constructor for this class should have filled in the default values (0 stars, all but the first locked - on xbox our default xml file should always have the default values - we cannot save information to that file as it is a binary xnb file that can't be changed at run time) Do not call this until we know the PlayerIndex the player is using!
public CheckForSave ( ) : bool
리턴 bool

Draw() 공개 메소드

Draws the menu on the screen
public Draw ( SpriteBatch spriteBatch, Matrix scale ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch Canvas we are drawing to
scale Matrix
리턴 void

GetLevelCollect() 공개 메소드

public GetLevelCollect ( ) : int
리턴 int

GetLevelDeath() 공개 메소드

public GetLevelDeath ( ) : int
리턴 int

GetLevelTime() 공개 메소드

public GetLevelTime ( ) : int
리턴 int

Load() 공개 메소드

Loads all the content needed for the levels
public Load ( Microsoft.Xna.Framework.Content.ContentManager content ) : void
content Microsoft.Xna.Framework.Content.ContentManager
리턴 void

Reset() 공개 메소드

Resets the world system
public Reset ( ) : void
리턴 void

Save() 공개 메소드

Saves level unlock and scoring information PC saving is straightforward - but xDoc.Save() will not work on xbox360. Instead we use the built in XmlSerializer class to serialize an element out to an xml file. We build our Xelement like normal - but instead of saving that directly using XDocument.Save() we place this XElement into a struct, and use XmlSerializer to serialize the data out into a storage device on the xbox.
public Save ( ) : void
리턴 void

UnlockWorld() 공개 메소드

Unlocks the given world
public UnlockWorld ( int world ) : void
world int The world.
리턴 void

Update() 공개 메소드

Handle any changes while on the level selection menu
public Update ( GameTime gameTime, GameStates &gameState, Level &currentLevel ) : void
gameTime Microsoft.Xna.Framework.GameTime Current time within the game
gameState GameStates Current gamestate of the game
currentLevel Level Current level of the game
리턴 void

UpdateStarCount() 공개 메소드

Updates the star count.
public UpdateStarCount ( ) : void
리턴 void

WorldSelect() 공개 메소드

Constructs the menu screen that allows the player to select a level
public WorldSelect ( IControlScheme controlScheme, GraphicsDeviceManager graphics ) : System
controlScheme IControlScheme Controls that the player are using
graphics GraphicsDeviceManager
리턴 System

프로퍼티 상세

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

public static string LevelDirectory
리턴 string