C# Class PrinceGame.RoomNew

Show file Open project: salvadorc17/Prince-Monogame Class Usage Examples

Public Properties

Property Type Description
BOTTOM_LIMIT int
ExitTile Exit
elements List
heightInLevel int
map Map
maze Maze
roomIndex int
roomName string
roomStart bool
roomType int
roomX int
roomY int
roomZ int
tilesTemporaney System.Collections.ArrayList
widthInLevel int

Public Methods

Method Description
Dispose ( ) : void

Unloads the level content.

Draw ( GameTime gameTime, SpriteBatch spriteBatch ) : void

Draw everything in the level from background to foreground.

DrawMask ( GameTime gameTime, SpriteBatch spriteBatch ) : void

Draw everything in the level from background to foreground.

DrawSprites ( GameTime gameTime, SpriteBatch spriteBatch ) : void
GetBounds ( int x, int y ) : Rectangle

Gets the bounding rectangle of a Tile in world space.

GetCollision ( int x, int y ) : Enumeration.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.

GetExit ( int x, int y ) : Exit
GetTile ( Vector2 playerPosition ) : Tile
GetTile ( int x, int y ) : Tile
GetTiles ( Enumeration tileType ) : List
GetType ( int x, int y ) : Enumeration.TileType
LooseShake ( ) : void
RoomNew ( Maze maze, string filePath, int roomIndex, int roomType ) : System
SpritesInRoom ( ) : List
StartNewLife ( GraphicsDevice graphicsDevice ) : void

Restores the player to the starting point to try the level again.

SubsTile ( Vector2 coordinate, Enumeration tileType ) : void
SubsTileState ( Vector2 position, Enumeration state ) : void
Update ( GameTime gameTime, KeyboardState keyboardState, GamePadState gamePadState, TouchCollection touchState, AccelerometerState accelState, DisplayOrientation orientation ) : void
getBoundTiles ( Rectangle playerBounds ) : Vector4
getCenterTile ( Rectangle playerBounds ) : Vector2

Private Methods

Method Description
DrawTilesBlocks ( GameTime gametime, SpriteBatch spriteBatch ) : void
DrawTilesBlocks2 ( GameTime gametime, SpriteBatch spriteBatch ) : void
DrawTilesDown ( GameTime gametime, SpriteBatch spriteBatch ) : void
DrawTilesInverseNew ( GameTime gametime, SpriteBatch spriteBatch ) : void
DrawTilesLeft ( GameTime gametime, SpriteBatch spriteBatch ) : void
DrawTilesMask ( GameTime gametime, SpriteBatch spriteBatch ) : void
DrawTilesUp ( GameTime gametime, SpriteBatch spriteBatch ) : void
LoadTile ( Enumeration tiletype ) : Tile

Creates a new Tile. The other Tile loading methods typically chain to this method after performing their special logic.

LoadTile ( Enumeration tiletype, Enumeration state, int switchButton, Enumeration item, Enumeration nextTileType, float timeOpen ) : Tile
LoadTiles ( ) : void
UpdateItems ( GameTime gameTime, KeyboardState keyboardState, GamePadState gamePadState, TouchCollection touchState, AccelerometerState accelState, DisplayOrientation orientation ) : void
UpdateSprites ( GameTime gameTime, KeyboardState keyboardState, GamePadState gamePadState, TouchCollection touchState, AccelerometerState accelState, DisplayOrientation orientation ) : void
UpdateTiles ( GameTime gameTime, KeyboardState keyboardState, GamePadState gamePadState, TouchCollection touchState, AccelerometerState accelState, DisplayOrientation orientation ) : void
UpdateTilesLeft ( GameTime gameTime, KeyboardState keyboardState, GamePadState gamePadState, TouchCollection touchState, AccelerometerState accelState, DisplayOrientation orientation ) : void
UpdateTilesTemporaney ( GameTime gameTime, KeyboardState keyboardState, GamePadState gamePadState, TouchCollection touchState, AccelerometerState accelState, DisplayOrientation orientation ) : void
UpdateTilesUp ( GameTime gameTime, KeyboardState keyboardState, GamePadState gamePadState, TouchCollection touchState, AccelerometerState accelState, DisplayOrientation orientation ) : void

Method Details

Dispose() public method

Unloads the level content.
public Dispose ( ) : void
return void

Draw() public method

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

DrawMask() public method

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

DrawSprites() public method

public DrawSprites ( GameTime gameTime, SpriteBatch spriteBatch ) : void
gameTime Microsoft.Xna.Framework.GameTime
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
return void

GetBounds() public method

Gets the bounding rectangle of a Tile in world space.
public GetBounds ( int x, int y ) : Rectangle
x int
y int
return Microsoft.Xna.Framework.Rectangle

GetCollision() public method

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 ) : Enumeration.TileCollision
x int
y int
return Enumeration.TileCollision

GetExit() public method

public GetExit ( int x, int y ) : Exit
x int
y int
return Exit

GetTile() public method

public GetTile ( Vector2 playerPosition ) : Tile
playerPosition Vector2
return Tile

GetTile() public method

public GetTile ( int x, int y ) : Tile
x int
y int
return Tile

GetTiles() public method

public GetTiles ( Enumeration tileType ) : List
tileType Enumeration
return List

GetType() public method

public GetType ( int x, int y ) : Enumeration.TileType
x int
y int
return Enumeration.TileType

LooseShake() public method

public LooseShake ( ) : void
return void

RoomNew() public method

public RoomNew ( Maze maze, string filePath, int roomIndex, int roomType ) : System
maze Maze
filePath string
roomIndex int
roomType int
return System

SpritesInRoom() public method

public SpritesInRoom ( ) : List
return List

StartNewLife() public method

Restores the player to the starting point to try the level again.
public StartNewLife ( GraphicsDevice graphicsDevice ) : void
graphicsDevice GraphicsDevice
return void

SubsTile() public method

public SubsTile ( Vector2 coordinate, Enumeration tileType ) : void
coordinate Vector2
tileType Enumeration
return void

SubsTileState() public method

public SubsTileState ( Vector2 position, Enumeration state ) : void
position Vector2
state Enumeration
return void

Update() public method

public Update ( GameTime gameTime, KeyboardState keyboardState, GamePadState gamePadState, TouchCollection touchState, AccelerometerState accelState, DisplayOrientation orientation ) : void
gameTime Microsoft.Xna.Framework.GameTime
keyboardState Microsoft.Xna.Framework.Input.KeyboardState
gamePadState Microsoft.Xna.Framework.Input.GamePadState
touchState TouchCollection
accelState AccelerometerState
orientation DisplayOrientation
return void

getBoundTiles() public method

public getBoundTiles ( Rectangle playerBounds ) : Vector4
playerBounds Microsoft.Xna.Framework.Rectangle
return Vector4

getCenterTile() public method

public getCenterTile ( Rectangle playerBounds ) : Vector2
playerBounds Microsoft.Xna.Framework.Rectangle
return Vector2

Property Details

BOTTOM_LIMIT public static property

public static int BOTTOM_LIMIT
return int

ExitTile public property

public Exit,PrinceGame ExitTile
return Exit

elements public property

public List elements
return List

heightInLevel public property

public int heightInLevel
return int

map public property

public Map,PrinceGame map
return Map

maze public property

public Maze maze
return Maze

roomIndex public property

public int roomIndex
return int

roomName public property

public string roomName
return string

roomStart public property

public bool roomStart
return bool

roomType public property

public int roomType
return int

roomX public property

public int roomX
return int

roomY public property

public int roomY
return int

roomZ public property

public int roomZ
return int

tilesTemporaney public property

public ArrayList,System.Collections tilesTemporaney
return System.Collections.ArrayList

widthInLevel public property

public int widthInLevel
return int