Minimap generation implemented. Release Build 8675.

pull/57/head
sigonasr2 8 months ago
parent 37a8847e4e
commit d2079f2a90
  1. 8
      Adventures in Lestoria/Adventures in Lestoria.vcxproj
  2. 9
      Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters
  3. 11
      Adventures in Lestoria/AdventuresInLestoria.cpp
  4. 2
      Adventures in Lestoria/AdventuresInLestoria.h
  5. 92
      Adventures in Lestoria/Minimap.cpp
  6. 48
      Adventures in Lestoria/Minimap.h
  7. 8
      Adventures in Lestoria/TODO.txt
  8. 2
      Adventures in Lestoria/Version.h
  9. BIN
      Adventures in Lestoria/assets/screenshot10.png
  10. BIN
      Adventures in Lestoria/assets/screenshot11.png
  11. BIN
      Adventures in Lestoria/assets/screenshot12.png
  12. BIN
      Adventures in Lestoria/assets/screenshot8.png
  13. BIN
      Adventures in Lestoria/assets/screenshot9.png
  14. BIN
      x64/Release/Adventures in Lestoria.exe

@ -411,6 +411,10 @@
<SubType>
</SubType>
</ClInclude>
<ClInclude Include="Minimap.h">
<SubType>
</SubType>
</ClInclude>
<ClInclude Include="olcPGEX_SplashScreen.h" />
<ClInclude Include="PlayerMoneyLabel.h">
<SubType>
@ -749,6 +753,10 @@
</SubType>
</ClCompile>
<ClCompile Include="Meteor.cpp" />
<ClCompile Include="Minimap.cpp">
<SubType>
</SubType>
</ClCompile>
<ClCompile Include="NPC.cpp">
<SubType>
</SubType>

@ -627,6 +627,12 @@
<ClInclude Include="emscripten_compat.h">
<Filter>Header Files\steam</Filter>
</ClInclude>
<ClInclude Include="SteamStatsReceivedHandler.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Minimap.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Player.cpp">
@ -1001,6 +1007,9 @@
<ClCompile Include="SteamStatsReceivedHandler.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Minimap.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="cpp.hint" />

@ -1805,6 +1805,10 @@ void AiL::RenderHud(){
std::string displayText=player->notificationDisplay.first;
DrawShadowStringPropDecal(vf2d{float(ScreenWidth()/2),float(ScreenHeight()/4)-24}-GetTextSizeProp(displayText)/2,displayText,BLUE,VERY_DARK_BLUE);
}
minimap.Update();
minimap.Draw();
DisplayBossEncounterInfo();
#ifdef _DEBUG
if("debug_player_info"_I){
@ -2215,6 +2219,13 @@ void AiL::_PrepareLevel(MapName map,MusicChange changeMusic){
});
#pragma endregion
#pragma region Foreground and Upper Foreground Tile Fade Group Setup (Loading phase 3.5)
LoadingScreen::AddPhase([&](){
minimap.Initialize();
return true;
});
#pragma endregion
#pragma region Foreground and Upper Foreground Tile Fade Group Setup (Loading phase 4)
LoadingScreen::AddPhase([&](){
std::set<vi2d>foregroundTilesAdded,upperForegroundTilesAdded;

@ -56,6 +56,7 @@ All rights reserved.
#include "olcPixelGameEngine.h"
#include "DynamicCounter.h"
#include "UndefKeys.h"
#include "Minimap.h"
class SteamKeyboardCallbackHandler;
@ -185,6 +186,7 @@ private:
float vignetteDisplayTime=0.f;
bool savingFile=false;
bool prevStageCompleted=false;
Minimap minimap;
void ValidateGameStatus();
void _PrepareLevel(MapName map,MusicChange changeMusic);

@ -0,0 +1,92 @@
#pragma region License
/*
License (OLC-3)
~~~~~~~~~~~~~~~
Copyright 2024 Joshua Sigona <sigonasr2@gmail.com>
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions or derivations of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions or derivative works in binary form must reproduce the above
copyright notice. This list of conditions and the following disclaimer must be
reproduced in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may
be used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/
#pragma endregion
#include "AdventuresInLestoria.h"
#include "DEFINES.h"
#include "Unlock.h"
INCLUDE_game
void Minimap::Initialize(){
if(minimap.Sprite()==nullptr)minimap.Create(1,1);
if(cover.Sprite()==nullptr)cover.Create(1,1);
#pragma region Cleanup minimap and cover images
minimap.Sprite()->Resize(game->GetCurrentMapData().width,game->GetCurrentMapData().height);
cover.Sprite()->Resize(game->GetCurrentMapData().width,game->GetCurrentMapData().height);
game->SetDrawTarget(minimap.Sprite());
game->Clear(WHITE);
game->SetPixelMode(Pixel::ALPHA);
game->SetDrawTarget(cover.Sprite());
game->Clear(BLANK);
//Will update the minimap decal at the end, since we are about to change it anyways.
cover.Decal()->Update();
#pragma endregion
for(int x=0;x<game->GetCurrentMapData().width;x++){
for(int y=0;y<game->GetCurrentMapData().height;y++){
bool tileFound=false;
for(const LayerTag&layer:game->MAP_DATA[game->GetCurrentLevel()].GetLayers()){
if(Unlock::IsUnlocked(layer.unlockCondition)){
int tileID=layer.tiles[y][x]-1;
if(tileID!=-1){
tileFound=true;
if(game->GetTileCollision(game->GetCurrentMapName(),vf2d{float(x),float(y)}*game->GetCurrentMapData().tilewidth)!=game->NO_COLLISION){
minimap.Sprite()->SetPixel({x,y},BLACK);
}
break;
}
}
}
if(!tileFound){
game->SetPixelMode(Pixel::ALPHA);
minimap.Sprite()->SetPixel({x,y},BLANK);
game->SetPixelMode(Pixel::NORMAL);
}
}
}
minimap.Decal()->Update();
}
void Minimap::Update(){
}
void Minimap::Draw(){
game->DrawDecal(vf2d{float(game->ScreenWidth()-minimap.Sprite()->width),0},minimap.Decal());
}

@ -0,0 +1,48 @@
#pragma region License
/*
License (OLC-3)
~~~~~~~~~~~~~~~
Copyright 2024 Joshua Sigona <sigonasr2@gmail.com>
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions or derivations of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions or derivative works in binary form must reproduce the above
copyright notice. This list of conditions and the following disclaimer must be
reproduced in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may
be used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/
#pragma endregion
#pragma once
class Minimap{
public:
void Initialize();
void Update();
void Draw();
private:
Renderable minimap;
Renderable cover;
};

@ -19,6 +19,14 @@ Steel Weapons appear in the demo for Chapter 2.
Update display counters on the overworld map.
Pressing movement keys that negate each other shouldn't cause a walking animation to occur.
>Start with a completely white image.
>Iterate through all tiles, no tile means set to transparent. Collision tile means set to black.
>Generate a blank map cover image.
>As the player navigates around the map, the blank map canvas gets updated based on distance.
>If a chunk has not been explored yet, it gets flagged as explored (probably unlock the chunks around the player as well).
>When a map is visited later, all visited chunks are revealed again.
============================================
Consider a "killed by player" / "marked by player" flag for monsters to determine if a player gets credit for a monster kill (for achievements)
Make another actions config file for the main build (The app # is different)

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 1
#define VERSION_PATCH 0
#define VERSION_BUILD 8666
#define VERSION_BUILD 8675
#define stringify(a) stringify_(a)
#define stringify_(a) #a

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Loading…
Cancel
Save