C# 클래스 Platformer.Levels.Level

A uniform grid of tiles with collections of gems and enemies. The level owns the player and controls the game's win and lose conditions as well as scoring.
상속: IDisposable
파일 보기 프로젝트 열기: zmthy/play-dead 1 사용 예제들

공개 메소드들

메소드 설명
Dispose ( ) : void
DrawBehind ( GameTime gameTime, SpriteBatch spriteBatch ) : void

Draw everything in the level from background to foreground.

DrawInFront ( GameTime gameTime, SpriteBatch spriteBatch ) : void
GetBounds ( int x, int y ) : RectangleF

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.

GetTileCollisionBehindPlayer ( Vector2 playerPosition ) : TileCollision
GetTileCollisionBelowPlayer ( Vector2 playerPosition ) : TileCollision
Level ( String name, int width, int height, Microsoft.Xna.Framework.Content.ContentManager content ) : System
LoadContent ( ) : void
Update ( Player player, GameTime gameTime, KeyboardState keyboardState, InputManager inputManager ) : void

Updates all objects in the world, performs collision between them, and handles the time limit with scoring.

UpdateSpawn ( Spawner spawner ) : void

Called by a Spawner when it has been activated.

activate ( string active ) : void

Activates a particular activatable.

addActivatable ( string tileID, IActivatable active ) : void

Adds and activatable item to the activatables list.

addActivator ( string tileID, Tiles actor ) : void

Adds an activator into the activators list.

addBind ( string actorName, string activeName ) : void

Binds and activator to a particular activatable.

addMoveable ( string tileID, MoveableTile mTile ) : void

Adds a moveable tile to the level. If the ID of the tile already exists then the tile is linked to the exiting tile as its leader.

addTile ( int x, int y ) : void

Adds an empty passable tile into the tile array.

addTile ( int x, int y, Tile newTile ) : void

Adds a tile into the tile array.

getGridPosition ( float x, float y ) : Vector2
getTile ( int x, int y ) : Tile
isTileInBounds ( int x, int y ) : bool

메소드 상세

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

DrawBehind() 공개 메소드

Draw everything in the level from background to foreground.
public DrawBehind ( GameTime gameTime, SpriteBatch spriteBatch ) : void
gameTime Microsoft.Xna.Framework.GameTime
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
리턴 void

DrawInFront() 공개 메소드

public DrawInFront ( GameTime gameTime, SpriteBatch spriteBatch ) : void
gameTime Microsoft.Xna.Framework.GameTime
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
리턴 void

GetBounds() 공개 메소드

Gets the bounding rectangle of a tile in world space.
public GetBounds ( int x, int y ) : RectangleF
x int
y int
리턴 RectangleF

GetCollision() 공개 메소드

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.
public GetCollision ( int x, int y ) : TileCollision
x int
y int
리턴 TileCollision

GetTileCollisionBehindPlayer() 공개 메소드

public GetTileCollisionBehindPlayer ( Vector2 playerPosition ) : TileCollision
playerPosition Vector2
리턴 TileCollision

GetTileCollisionBelowPlayer() 공개 메소드

public GetTileCollisionBelowPlayer ( Vector2 playerPosition ) : TileCollision
playerPosition Vector2
리턴 TileCollision

Level() 공개 메소드

public Level ( String name, int width, int height, Microsoft.Xna.Framework.Content.ContentManager content ) : System
name String
width int
height int
content Microsoft.Xna.Framework.Content.ContentManager
리턴 System

LoadContent() 공개 메소드

public LoadContent ( ) : void
리턴 void

Update() 공개 메소드

Updates all objects in the world, performs collision between them, and handles the time limit with scoring.
public Update ( Player player, GameTime gameTime, KeyboardState keyboardState, InputManager inputManager ) : void
player Player
gameTime Microsoft.Xna.Framework.GameTime
keyboardState Microsoft.Xna.Framework.Input.KeyboardState
inputManager InputManager
리턴 void

UpdateSpawn() 공개 메소드

Called by a Spawner when it has been activated.
public UpdateSpawn ( Spawner spawner ) : void
spawner Platformer.Tiles.Spawner The spawner to set as the active spawn point.
리턴 void

activate() 공개 메소드

Activates a particular activatable.
public activate ( string active ) : void
active string The ID of the activatable.
리턴 void

addActivatable() 공개 메소드

Adds and activatable item to the activatables list.
public addActivatable ( string tileID, IActivatable active ) : void
tileID string The ID of the tilwe.
active IActivatable The activatable instance.
리턴 void

addActivator() 공개 메소드

Adds an activator into the activators list.
public addActivator ( string tileID, Tiles actor ) : void
tileID string The ID of the tile.
actor Tiles The activator instance.
리턴 void

addBind() 공개 메소드

Binds and activator to a particular activatable.
public addBind ( string actorName, string activeName ) : void
actorName string The activator which will trigger.
activeName string The activatable which will be activated.
리턴 void

addMoveable() 공개 메소드

Adds a moveable tile to the level. If the ID of the tile already exists then the tile is linked to the exiting tile as its leader.
public addMoveable ( string tileID, MoveableTile mTile ) : void
tileID string The ID of the tile.
mTile Platformer.Tiles.MoveableTile The moveable tile instance.
리턴 void

addTile() 공개 메소드

Adds an empty passable tile into the tile array.
public addTile ( int x, int y ) : void
x int
y int
리턴 void

addTile() 공개 메소드

Adds a tile into the tile array.
public addTile ( int x, int y, Tile newTile ) : void
x int
y int
newTile Platformer.Tiles.Tile
리턴 void

getGridPosition() 공개 메소드

public getGridPosition ( float x, float y ) : Vector2
x float
y float
리턴 Vector2

getTile() 공개 메소드

public getTile ( int x, int y ) : Tile
x int
y int
리턴 Platformer.Tiles.Tile

isTileInBounds() 공개 메소드

public isTileInBounds ( int x, int y ) : bool
x int
y int
리턴 bool