SDL SPOOKY PLATFORMER ENGINE
0.2.0
An implementation of a platformer using sdl, implemented using an entity component system and efficient collision management.
|
#include <TileMapComponent.hpp>
Public Member Functions | |
TileMapComponent (std::string tileSheetFileName, int tileRows, int tileCols, int _TileWidth, int _TileHeight, int mapRows, int mapCols, SDL_Renderer *ren) | |
~TileMapComponent () | |
void | PrintMap () |
void | SetTile (int row, int col, int type) |
int | GetTileType (int row, int col) |
void | Render (SDL_Renderer *ren) |
void | Update (float deltaTime) |
Update this component according to the deltaTime. More... | |
![]() | |
Component () | |
virtual | ~Component () |
Protected Attributes | |
int | m_TileRows |
int | m_TileCols |
int | m_TileWidth |
int | m_TileHeight |
int | m_MapRows |
int | m_MapCols |
SDL_Surface * | m_TileSpriteSheet |
SDL_Texture * | m_Texture |
int * | m_Tiles |
![]() | |
GameObject * | entity |
The entitity to which this component belongs to. More... | |
This is a minimal implementation of a TileMap
TileMapComponent::TileMapComponent | ( | std::string | tileSheetFileName, |
int | tileRows, | ||
int | tileCols, | ||
int | _TileWidth, | ||
int | _TileHeight, | ||
int | mapRows, | ||
int | mapCols, | ||
SDL_Renderer * | ren | ||
) |
Constructor for a tilemap
TileMapComponent::~TileMapComponent | ( | ) |
Destructor for a tilemap
int TileMapComponent::GetTileType | ( | int | row, |
int | col | ||
) |
Return the tile type at an x and y position
void TileMapComponent::PrintMap | ( | ) |
Function for printing text to console
|
virtual |
Draw all of the tiles in the tilemap
Reimplemented from Component.
void TileMapComponent::SetTile | ( | int | row, |
int | col, | ||
int | type | ||
) |
Set the 'type' of tile at an x and y position
|
inlinevirtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |