diff --git a/Adventures in Lestoria/Adventures in Lestoria.tiled-project b/Adventures in Lestoria/Adventures in Lestoria.tiled-project index 3d23d5d6..00863d35 100644 --- a/Adventures in Lestoria/Adventures in Lestoria.tiled-project +++ b/Adventures in Lestoria/Adventures in Lestoria.tiled-project @@ -33,6 +33,17 @@ "wangset" ] }, + { + "id": 30, + "name": "Backdrop", + "storageType": "string", + "type": "enum", + "values": [ + "None", + "forest" + ], + "valuesAsFlags": false + }, { "id": 27, "name": "BGM", @@ -213,6 +224,12 @@ "drawFill": true, "id": 19, "members": [ + { + "name": "Backdrop", + "propertyType": "Backdrop", + "type": "string", + "value": "None" + }, { "name": "Background Music", "propertyType": "BGM", diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj b/Adventures in Lestoria/Adventures in Lestoria.vcxproj index 29f9bfcd..c8932fa2 100644 --- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj +++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj @@ -679,6 +679,7 @@ + diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters b/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters index 4aaa89a8..dce5a6f2 100644 --- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters +++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters @@ -843,6 +843,9 @@ Configurations\Audio + + Configurations\GFX + diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 1bac9a7a..36afb7f3 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -76,6 +76,7 @@ All rights reserved. INCLUDE_EMITTER_LIST INCLUDE_ITEM_CATEGORIES +INCLUDE_BACKDROP_DATA bool _DEBUG_MAP_LOAD_INFO = false; //360x240 @@ -137,6 +138,9 @@ AiL::AiL() std::string ITEM_STATS_CONFIG = CONFIG_PATH + "item_stats_config"_S; utils::datafile::Read(DATA,ITEM_STATS_CONFIG); + std::string BACKDROP_CONFIG = CONFIG_PATH + "backdrop_config"_S; + utils::datafile::Read(DATA,BACKDROP_CONFIG); + auto keys=DATA.GetProperty("ItemConfiguration"); for(auto&[key,value]:keys){ std::string config=DATA["ItemConfiguration"][key].GetString(); @@ -835,7 +839,11 @@ void AiL::RenderWorld(float fElapsedTime){ } #pragma region Basic Tile Layer Rendering - FillRectDecal({0,0},GetScreenSize(),{100,180,100}); + if(GetCurrentMap().backdrop.length()>0){ + view.DrawPartialDecal({0,0},WINDOW_SIZE,BACKDROP_DATA[GetCurrentMap().backdrop].Decal(),"Backdrop Config.Speed Ratio"_F*-camera.GetPosition(),WINDOW_SIZE); + }else{ + FillRectDecal({0,0},GetScreenSize(),{100,180,100}); + } for(RenderMode mode=RenderMode::REFLECTIVE_TILES;mode<=RenderMode::EMPTY_TILES;mode=RenderMode(int(mode)+1)){ if(mode==RenderMode::NORMAL_TILES){ SetDecalMode(DecalMode::ADDITIVE); @@ -929,12 +937,24 @@ void AiL::RenderWorld(float fElapsedTime){ }break; case RenderMode::EMPTY_TILES:{ if(visibleTiles.count({x,y})){ - view.FillRectDecal(vi2d{x,y}*GetCurrentMapData().tilewidth,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},{100,180,100}); + #pragma region Render Backdrop + if(GetCurrentMap().backdrop.length()>0){ + vf2d tileWorldPos=vi2d{x,y}*GetCurrentMapData().tilewidth; + view.DrawPartialDecal(tileWorldPos,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},BACKDROP_DATA[GetCurrentMap().backdrop].Decal(),"Backdrop Config.Speed Ratio"_F*-camera.GetPosition()+tileWorldPos,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)}); + }else{ + view.FillRectDecal(vi2d{x,y}*GetCurrentMapData().tilewidth,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},{100,180,100}); + } + #pragma endregion } }break; } }else{ - view.FillRectDecal(vi2d{x,y}*GetCurrentMapData().tilewidth,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},{100,180,100}); + if(GetCurrentMap().backdrop.length()>0){ + vf2d tileWorldPos=vi2d{x,y}*GetCurrentMapData().tilewidth; + view.DrawPartialDecal(tileWorldPos,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},BACKDROP_DATA[GetCurrentMap().backdrop].Decal(),"Backdrop Config.Speed Ratio"_F*-camera.GetPosition()+tileWorldPos,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)}); + }else{ + view.FillRectDecal(vi2d{x,y}*GetCurrentMapData().tilewidth,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},{100,180,100}); + } } } } @@ -2171,6 +2191,7 @@ bool AiL::OnUserDestroy(){ for(auto&[key,value]:MonsterData::imgs){ delete value; } + BACKDROP_DATA.clear(); return true; } @@ -2179,6 +2200,11 @@ void AiL::InitializeLevels(){ InitializeLevel("map_path"_S+operator""_S(("Levels."+key).c_str(),("Levels."+key).size()),key); } + for(auto&[key,size]:DATA["Backdrops"]){ + Renderable&backdrop=BACKDROP_DATA[key]; + backdrop.Load("backdrop_directory"_S+DATA["Backdrops"][key].GetString(),nullptr,false,false); + } + Test::RunMapTests(); } diff --git a/Adventures in Lestoria/AdventuresInLestoria.h b/Adventures in Lestoria/AdventuresInLestoria.h index 8386f969..b6f785bf 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.h +++ b/Adventures in Lestoria/AdventuresInLestoria.h @@ -54,6 +54,7 @@ All rights reserved. #include "discord.h" #endif #include "Audio.h" +#include "olcPGEX_SplashScreen.h" class AiL : public olc::PixelGameEngine { @@ -63,6 +64,7 @@ class AiL : public olc::PixelGameEngine friend class sig::Animation; friend class Audio; std::unique_ptrplayer; + SplashScreen splash; public: Pathfinding pathfinder; static InputGroup KEY_CONFIRM; diff --git a/Adventures in Lestoria/DEFINES.h b/Adventures in Lestoria/DEFINES.h index 09ffceb2..154b3cdc 100644 --- a/Adventures in Lestoria/DEFINES.h +++ b/Adventures in Lestoria/DEFINES.h @@ -36,6 +36,11 @@ All rights reserved. */ #pragma endregion #pragma once + +#include + +using BackdropName=std::string; + #define INCLUDE_ANIMATION_DATA extern safemapANIMATION_DATA; #define INCLUDE_MONSTER_LIST extern std::vectorMONSTER_LIST; #define INCLUDE_SPAWNER_LIST extern std::vectorSPAWNER_LIST; @@ -53,6 +58,9 @@ All rights reserved. #define DO_NOTHING [](MenuFuncData data){return true;} #define INCLUDE_WINDOW_SIZE extern vi2d WINDOW_SIZE; +#define INCLUDE_BACKDROP_DATA extern std::mapBACKDROP_DATA; + + #define INCLUDE_CENTERED extern const vf2d Menu::CENTERED; #define ACCESS_PLAYER Player*p=game->GetPlayer(); diff --git a/Adventures in Lestoria/Map.cpp b/Adventures in Lestoria/Map.cpp index 98dc9902..8d5a5f46 100644 --- a/Adventures in Lestoria/Map.cpp +++ b/Adventures in Lestoria/Map.cpp @@ -41,8 +41,11 @@ All rights reserved. INCLUDE_game +using BackdropName=std::string; + float TileGroup::FADE_TIME=0.3f; uint8_t TileGroup::FADE_AMT=160; +std::mapBACKDROP_DATA; Map&MapHelper::MapFromString(std::string mapName){ return game->MAP_DATA.at(mapName); diff --git a/Adventures in Lestoria/TMXParser.h b/Adventures in Lestoria/TMXParser.h index ad63793f..423f82dd 100644 --- a/Adventures in Lestoria/TMXParser.h +++ b/Adventures in Lestoria/TMXParser.h @@ -101,6 +101,7 @@ struct Map{ std::vectorenvironmentalAudioData; std::string mapType=""; std::string bgmSongName=""; + BackdropName backdrop=""; std::setspawns; std::map SpawnerData; //Spawn groups have IDs, mobs associate which spawner they are tied to via this ID. std::map> ZoneData; @@ -365,6 +366,11 @@ class TMXParser{ parsedMapInfo.bgmSongName=newTag.data["value"]; } } else + if (newTag.tag=="property"&&newTag.data["name"]=="Backdrop") { + if(newTag.data["value"]!="None"){ //None is a default value that we ignore. + parsedMapInfo.backdrop=newTag.data["value"]; + } + } else if (newTag.tag=="object"&&newTag.data["type"]=="AudioEnvironmentalSound") { parsedMapInfo.environmentalAudioData.emplace_back(); prevAudioData=&parsedMapInfo.environmentalAudioData.back(); diff --git a/Adventures in Lestoria/TODO.txt b/Adventures in Lestoria/TODO.txt index a01f22c1..19970cb2 100644 --- a/Adventures in Lestoria/TODO.txt +++ b/Adventures in Lestoria/TODO.txt @@ -1,11 +1,6 @@ January 1st =========== The Hub / NPC Interactions -Audio Engine - - Audio Ambience Zones - - Menu Sound Effects - - Attack / Enemy Sound Effects - - Music Loading/Looping Settings Menu - Any settings should be saved to the save file! - Volume Controls @@ -18,8 +13,6 @@ Settings Menu -Click on title screen should not process as input immediately. -Investigate why frame rate matters for intro screen. --Warrior slash should occur even with no target --Add in other story plates -Faster main menu screen transition -Simplify map collision tiles by removing the requirement for hidden boundaries. -Loading should happen on fadeout. diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 72f44168..8eec53d8 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 0 #define VERSION_MINOR 2 #define VERSION_PATCH 1 -#define VERSION_BUILD 5533 +#define VERSION_BUILD 5549 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/Campaigns/1_1_v2.png b/Adventures in Lestoria/assets/Campaigns/1_1_v2.png deleted file mode 100644 index 35a8458f..00000000 Binary files a/Adventures in Lestoria/assets/Campaigns/1_1_v2.png and /dev/null differ diff --git a/Adventures in Lestoria/assets/Campaigns/1_1_v2.tmx b/Adventures in Lestoria/assets/Campaigns/1_1_v2.tmx index 7487bfc5..c3bae73b 100644 --- a/Adventures in Lestoria/assets/Campaigns/1_1_v2.tmx +++ b/Adventures in Lestoria/assets/Campaigns/1_1_v2.tmx @@ -1,6 +1,7 @@ + diff --git a/Adventures in Lestoria/assets/Campaigns/1_2.tmx b/Adventures in Lestoria/assets/Campaigns/1_2.tmx index 62232b0f..a20a8771 100644 --- a/Adventures in Lestoria/assets/Campaigns/1_2.tmx +++ b/Adventures in Lestoria/assets/Campaigns/1_2.tmx @@ -1,6 +1,7 @@ + diff --git a/Adventures in Lestoria/assets/Campaigns/1_3.tmx b/Adventures in Lestoria/assets/Campaigns/1_3.tmx index b2f5a678..ea76d3b4 100644 --- a/Adventures in Lestoria/assets/Campaigns/1_3.tmx +++ b/Adventures in Lestoria/assets/Campaigns/1_3.tmx @@ -1,6 +1,7 @@ + diff --git a/Adventures in Lestoria/assets/Campaigns/1_4.tmx b/Adventures in Lestoria/assets/Campaigns/1_4.tmx index d3682d48..c568dea8 100644 --- a/Adventures in Lestoria/assets/Campaigns/1_4.tmx +++ b/Adventures in Lestoria/assets/Campaigns/1_4.tmx @@ -1,6 +1,7 @@ + diff --git a/Adventures in Lestoria/assets/Campaigns/1_5.tmx b/Adventures in Lestoria/assets/Campaigns/1_5.tmx index 286a6021..935b803f 100644 --- a/Adventures in Lestoria/assets/Campaigns/1_5.tmx +++ b/Adventures in Lestoria/assets/Campaigns/1_5.tmx @@ -1,6 +1,7 @@ + diff --git a/Adventures in Lestoria/assets/Campaigns/1_6.tmx b/Adventures in Lestoria/assets/Campaigns/1_6.tmx index a385e6a6..c7159369 100644 --- a/Adventures in Lestoria/assets/Campaigns/1_6.tmx +++ b/Adventures in Lestoria/assets/Campaigns/1_6.tmx @@ -1,6 +1,7 @@ + diff --git a/Adventures in Lestoria/assets/Campaigns/1_7.tmx b/Adventures in Lestoria/assets/Campaigns/1_7.tmx index a16a70c0..538b555f 100644 --- a/Adventures in Lestoria/assets/Campaigns/1_7.tmx +++ b/Adventures in Lestoria/assets/Campaigns/1_7.tmx @@ -1,6 +1,7 @@ + diff --git a/Adventures in Lestoria/assets/Campaigns/1_8.tmx b/Adventures in Lestoria/assets/Campaigns/1_8.tmx index befbdc41..64e0a612 100644 --- a/Adventures in Lestoria/assets/Campaigns/1_8.tmx +++ b/Adventures in Lestoria/assets/Campaigns/1_8.tmx @@ -1,6 +1,7 @@ + diff --git a/Adventures in Lestoria/assets/Campaigns/Boss_1_v2.tmx b/Adventures in Lestoria/assets/Campaigns/Boss_1_v2.tmx index 3e924b3d..10c2d5c5 100644 --- a/Adventures in Lestoria/assets/Campaigns/Boss_1_v2.tmx +++ b/Adventures in Lestoria/assets/Campaigns/Boss_1_v2.tmx @@ -1,6 +1,7 @@ + diff --git a/Adventures in Lestoria/assets/backgrounds/forest_backdrop.png b/Adventures in Lestoria/assets/backgrounds/forest_backdrop.png new file mode 100644 index 00000000..1dadf8b8 Binary files /dev/null and b/Adventures in Lestoria/assets/backgrounds/forest_backdrop.png differ diff --git a/Adventures in Lestoria/assets/config/configuration.txt b/Adventures in Lestoria/assets/config/configuration.txt index b4c725ed..2f7452f6 100644 --- a/Adventures in Lestoria/assets/config/configuration.txt +++ b/Adventures in Lestoria/assets/config/configuration.txt @@ -59,6 +59,12 @@ item_img_directory = items/ # Path to story files story_directory = config/story/ +# Path to backdrop config file +backdrop_config = gfx/backdrops.txt + +# Path to backdrop background files +backdrop_directory = assets/backgrounds/ + # Path to sound effect files sfx_directory = assets/sounds/ diff --git a/Adventures in Lestoria/assets/config/gfx/backdrops.txt b/Adventures in Lestoria/assets/config/gfx/backdrops.txt new file mode 100644 index 00000000..e83a9181 --- /dev/null +++ b/Adventures in Lestoria/assets/config/gfx/backdrops.txt @@ -0,0 +1,10 @@ +Backdrops +{ + forest = forest_backdrop.png +} + +Backdrop Config +{ + # Amount to move per pixel of actual world space. + Speed Ratio = 0.125 +} \ No newline at end of file diff --git a/Adventures in Lestoria/assets/glomzy-05-1x.png b/Adventures in Lestoria/assets/glomzy-05-1x.png new file mode 100644 index 00000000..b0f94c59 Binary files /dev/null and b/Adventures in Lestoria/assets/glomzy-05-1x.png differ diff --git a/Adventures in Lestoria/pixelGameEngine.cpp b/Adventures in Lestoria/pixelGameEngine.cpp index 8d693b5c..f841f5e6 100644 --- a/Adventures in Lestoria/pixelGameEngine.cpp +++ b/Adventures in Lestoria/pixelGameEngine.cpp @@ -50,4 +50,6 @@ All rights reserved. #define TSX_PARSER_SETUP #include "TSXParser.h" #define OLC_PGEX_MINIAUDIO -#include "olcPGEX_MiniAudio.h" \ No newline at end of file +#include "olcPGEX_MiniAudio.h" +#define OLC_PGEX_SPLASHSCREEN +#include "olcPGEX_SplashScreen.h" \ No newline at end of file diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index a41fefd6..eeb5050e 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ