SDL SPOOKY PLATFORMER ENGINE  0.2.0
An implementation of a platformer using sdl, implemented using an entity component system and efficient collision management.
Public Member Functions | Protected Attributes | List of all members
TileMapComponent Class Reference

#include <TileMapComponent.hpp>

Inheritance diagram for TileMapComponent:
Component CustomTileMap

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...
 
- Public Member Functions inherited from Component
 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
 
- Protected Attributes inherited from Component
GameObjectentity
 The entitity to which this component belongs to. More...
 

Detailed Description

This is a minimal implementation of a TileMap

Constructor & Destructor Documentation

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

Member Function Documentation

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

void TileMapComponent::Render ( SDL_Renderer *  ren)
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

void TileMapComponent::Update ( float  deltaTime)
inlinevirtual

Update this component according to the deltaTime.

Implements Component.

Member Data Documentation

int TileMapComponent::m_MapCols
protected
int TileMapComponent::m_MapRows
protected
SDL_Texture* TileMapComponent::m_Texture
protected
int TileMapComponent::m_TileCols
protected
int TileMapComponent::m_TileHeight
protected
int TileMapComponent::m_TileRows
protected
int* TileMapComponent::m_Tiles
protected
SDL_Surface* TileMapComponent::m_TileSpriteSheet
protected
int TileMapComponent::m_TileWidth
protected

The documentation for this class was generated from the following files: