The open source repository for the action RPG game in development by Sig Productions titled 'Adventures in Lestoria'! https://forums.lestoria.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
AdventuresInLestoria/Crawler/Map.h

47 lines
1.0 KiB

#pragma once
#include "olcUTIL_Geometry2D.h"
struct XMLTag;
enum MapName{
CAMPAIGN_1_1,
CAMPAIGN_1_2,
BOSS_1,
WORLD_MAP
};
struct TileCollisionData{
geom2d::rect<int>collision;
};
struct TilesetData{
Renderable*tileset;
std::map<int,XMLTag>foregroundTiles;
std::map<int,XMLTag>upperForegroundTiles;
std::map<int,TileCollisionData>collision;
std::map<int,XMLTag>staircaseTiles;
};
struct TileRenderData{
Decal*tileset;
vi2d pos;
vi2d tileSheetPos;
};
struct TileGroup{
private:
geom2d::rect<int>range;
std::vector<TileRenderData>tiles;
int minX=0,minY=0,maxX=0,maxY=0;
public:
static float FADE_TIME;
//0-255. 255 indicates fully invisible.
static uint8_t FADE_AMT;
geom2d::rect<int>GetRange();
//The fade range is the bounds in which this tile group will be considered "in range" of a player, one tile in each direction further than its actual range.
geom2d::rect<int>GetFadeRange();
std::vector<TileRenderData>&GetTiles();
void InsertTile(TileRenderData tile);
bool playerBehind=false;
float fadeFactor=0.f;
};