Метод | Описание | |
---|---|---|
Dispose ( ) : void |
Unloads the level content.
|
|
Draw ( |
Draw everything in the level from background to foreground.
|
|
GetBounds ( int x, int y ) : |
Gets the bounding rectangle of a tile in world space.
|
|
GetCollision ( int x, int y ) : TileCollision |
Gets the collision mode of the tile at a particular location. This method handles tiles outside of the levels boundries by making it impossible to escape past the left or right edges, but allowing things to jump beyond the top of the level and fall off the bottom.
|
|
Level ( IServiceProvider serviceProvider, string path ) : System |
Constructs a new level.
|
|
StartNewLife ( ) : void |
Restores the player to the starting point to try the level again.
|
|
Update ( |
Updates all objects in the world, performs collision between them, and handles the time limit with scoring.
|
Метод | Описание | |
---|---|---|
DrawTiles ( BitmapBatch batch ) : void |
Draws each tile in the level.
|
|
LoadEnemyTile ( int x, int y, string spriteSet ) : |
Instantiates an enemy and puts him in the level.
|
|
LoadExitTile ( int x, int y ) : |
Remembers the location of the level's exit.
|
|
LoadGemTile ( int x, int y ) : |
Instantiates a gem and puts it in the level.
|
|
LoadStartTile ( int x, int y ) : |
Instantiates a player, puts him in the level, and remembers where to put him when he is resurrected.
|
|
LoadTile ( char tileType, int x, int y ) : |
Loads an individual tile's appearance and behavior.
|
|
LoadTile ( string name, TileCollision collision ) : |
Creates a new tile. The other tile loading methods typically chain to this method after performing their special logic.
|
|
LoadTiles ( string path ) : void |
Iterates over every tile in the structure file and loads its appearance and behavior. This method also validates that the file is well-formed with a player start point, exit, etc.
|
|
LoadVarietyTile ( string baseName, int variationCount, TileCollision collision ) : |
Loads a tile with a random appearance.
|
|
OnExitReached ( ) : void |
Called when the player reaches the level's exit.
|
|
OnGemCollected ( |
Called when a gem is collected.
|
|
OnPlayerKilled ( |
Called when the player is killed.
|
|
UpdateEnemies ( |
Animates each enemy and allow them to kill the player.
|
|
UpdateGems ( |
Animates each gem and checks to allows the player to collect them.
|
public Draw ( |
||
gameTime | ||
frame | Frame | |
materials | DefaultMaterialSet | |
Результат | void |
public GetBounds ( int x, int y ) : |
||
x | int | |
y | int | |
Результат |
public GetCollision ( int x, int y ) : TileCollision | ||
x | int | |
y | int | |
Результат | TileCollision |
public Level ( IServiceProvider serviceProvider, string path ) : System | ||
serviceProvider | IServiceProvider | /// The service provider that will be used to construct a ContentManager. /// |
path | string | /// The absolute path to the level file to be loaded. /// |
Результат | System |
public Update ( |
||
gameTime | ||
Результат | void |