C# 클래스 MrGravity.LevelSelect

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

공개 프로퍼티들

프로퍼티 타입 설명
Back int
LevelDirectory string
LevelList string
LevelThumbsDirectory string
Next int
Previous int
TrialLevelList string

공개 메소드들

메소드 설명
CheckForSave ( PlayerIndex player ) : void

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, GraphicsDeviceManager graphics, Matrix scale ) : void

Draws the menu on the screen

GetNextLevel ( ) : Level

Gets the next level in the game

LevelSelect ( IControlScheme controlScheme ) : System

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

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

Load the data that is needed to show the Level selection screen

Reset ( ) : Level

Resets all levels to be locked (except the first level) and resets all scores to 0 This should be changed a bit for our new world structure. Perhaps on xbox360 we can simply just reload the default xml file here (which is guaranteed to have default values within it if including it in the project in the proper state), and then save the game so the storage container contains the reset values as well. Additionally... I am not sure why this returns a level....

Save ( PlayerIndex player ) : 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.

UnlockNextLevel ( ) : void

Unlocks the next level in the game(if it is already unlocked than it won't do anything)

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

Handle any changes while on the level selection menu

비공개 메소드들

메소드 설명
HandleAPressed ( GameStates &gameState, Level &currentLevel ) : void

Handle what happens when the player presses A for all options

HandleDirectionKeys ( ) : void

Handle actions for each direction the player may press on their controller

메소드 상세

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 ( PlayerIndex player ) : void
player PlayerIndex
리턴 void

Draw() 공개 메소드

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

GetNextLevel() 공개 메소드

Gets the next level in the game
public GetNextLevel ( ) : Level
리턴 Level

LevelSelect() 공개 메소드

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

Load() 공개 메소드

Load the data that is needed to show the Level selection screen
public Load ( Microsoft.Xna.Framework.Content.ContentManager content, GraphicsDevice graphics ) : void
content Microsoft.Xna.Framework.Content.ContentManager Access to the content of the project
graphics GraphicsDevice Graphics that draws to the screen
리턴 void

Reset() 공개 메소드

Resets all levels to be locked (except the first level) and resets all scores to 0 This should be changed a bit for our new world structure. Perhaps on xbox360 we can simply just reload the default xml file here (which is guaranteed to have default values within it if including it in the project in the proper state), and then save the game so the storage container contains the reset values as well. Additionally... I am not sure why this returns a level....
public Reset ( ) : Level
리턴 Level

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 ( PlayerIndex player ) : void
player PlayerIndex
리턴 void

UnlockNextLevel() 공개 메소드

Unlocks the next level in the game(if it is already unlocked than it won't do anything)
public UnlockNextLevel ( ) : void
리턴 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

프로퍼티 상세

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

public static int Back
리턴 int

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

public static string LevelDirectory
리턴 string

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

public static string LevelList
리턴 string

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

public static string LevelThumbsDirectory
리턴 string

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

public static int Next
리턴 int

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

public static int Previous
리턴 int

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

public static string TrialLevelList
리턴 string