Property | Type | Description | |
---|---|---|---|
tileSheet | Microsoft.Xna.Framework.Graphics.Texture2D |
Method | Description | |
---|---|---|
CanPlaceBlock ( int x, int y, int z, BlockType block ) : bool |
Determines if a player can place a block at a specified position
|
|
CreateCamera ( ) : void |
Creates a camera object at a set size
|
|
Draw ( |
Draws the map blocks an entities
|
|
GetCollision ( int x, int y ) : BlockCollision |
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 MainCamera.btnLeft or MainCamera.btnRight edges, but allowing things to jump beyond the MainCamera.Top of the level and fall off the MainCamera.bottom.
|
|
GetTileBounds ( int x, int y ) : |
Gets the bounding rectangle of a tile in world space.
|
|
Map ( Microsoft.Xna.Framework.Game game, int width, int height ) : System |
Creates a client-side version of a map at the specified width and height (To be changed later once Init packet recieved)
|
|
PlaceTile ( int x, int y, Layer layer, BlockType block, bool sendMessage ) : void |
Places a tile at the specified position, WHILE taking into account it's TileType Mainly used for player block placement, if you are looking to place a block through the code Either use `Tiles[x,y,z] =` or, set sendMessage to false
|
|
SetMinimapColors ( ) : void |
Sets block's default colors from their image for use with the minimap
|
|
Update ( |
Updates the map's entities and handles input
|
|
UpdateTiles ( |
Handles logic for updating tiles (Ex: animation)
|
Method | Description | |
---|---|---|
DrawTiles ( |
Draws the foreground and background blocks of a map
|
|
HandleInput ( ) : void |
Handles input for the level, such as clicking blocks and selecting them
|
|
LoadContent ( ) : void |
Loads content needed for drawing on the client
|
public CanPlaceBlock ( int x, int y, int z, BlockType block ) : bool | ||
x | int | |
y | int | |
z | int | |
block | BlockType | |
return | bool |
public Draw ( |
||
spriteBatch | ||
gameTime | ||
return | void |
public GetCollision ( int x, int y ) : BlockCollision | ||
x | int | |
y | int | |
return | BlockCollision |
public GetTileBounds ( int x, int y ) : |
||
x | int | |
y | int | |
return |
public Map ( Microsoft.Xna.Framework.Game game, int width, int height ) : System | ||
game | Microsoft.Xna.Framework.Game | |
width | int | |
height | int | |
return | System |
public PlaceTile ( int x, int y, Layer layer, BlockType block, bool sendMessage ) : void | ||
x | int | The X position on the grid |
y | int | The Y position on the grid |
layer | Layer | The layer, either background or foreground |
block | BlockType | The block to place |
sendMessage | bool | Should the block be sent to the server or not |
return | void |
public Update ( |
||
gameTime | ||
return | void |
public UpdateTiles ( |
||
gameTime | ||
return | void |