Donut circle cooldown indicator test code.

mac-build
sigonasr2 6 months ago
parent 7fa02b0f7a
commit 97a9025830
  1. 10
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 1
      Adventures in Lestoria/AdventuresInLestoria.h
  3. 7
      Adventures in Lestoria/State_GameRun.cpp
  4. 2
      Adventures in Lestoria/Version.h
  5. 2
      Adventures in Lestoria/olcPixelGameEngine.h
  6. BIN
      x64/Release/Adventures in Lestoria.exe

@ -3673,6 +3673,15 @@ void AiL::InitializeGraphics(){
squareCircleCooldownPoints.push_back({0,0}); squareCircleCooldownPoints.push_back({0,0});
for(int i=0;i<=360;i+=4){ for(int i=0;i<=360;i+=4){
float angle=util::degToRad(float(i))-PI/2; float angle=util::degToRad(float(i))-PI/2;
#pragma region Donut Circle
const float innerArcRatio{0.8f};
donutCircleCooldownPoints.push_back(vf2d{cos(angle),sin(angle)});
donutCircleCooldownPoints.push_back(vf2d{cos(angle),sin(angle)}*innerArcRatio);
#pragma endregion
#pragma region Cooldown Circles
if(i==0){circleCooldownPoints.push_back(vf2d{cos(angle),sin(angle)});} if(i==0){circleCooldownPoints.push_back(vf2d{cos(angle),sin(angle)});}
circleCooldownPoints.push_back(vf2d{cos(angle),sin(angle)}); circleCooldownPoints.push_back(vf2d{cos(angle),sin(angle)});
vf2d point=vf2d{cos(angle),sin(angle)}*sqrt(2.1f); vf2d point=vf2d{cos(angle),sin(angle)}*sqrt(2.1f);
@ -3680,6 +3689,7 @@ void AiL::InitializeGraphics(){
point.y=std::clamp(point.y,-1.f,1.f); point.y=std::clamp(point.y,-1.f,1.f);
if(i==0){squareCircleCooldownPoints.push_back(point);} if(i==0){squareCircleCooldownPoints.push_back(point);}
squareCircleCooldownPoints.push_back(point); squareCircleCooldownPoints.push_back(point);
#pragma endregion
} }
for(auto&val:DATA["Images"].GetKeys()){ for(auto&val:DATA["Images"].GetKeys()){

@ -156,6 +156,7 @@ private:
std::vector<int>dropsBeforeLower,dropsAfterLower,dropsBeforeUpper,dropsAfterUpper; std::vector<int>dropsBeforeLower,dropsAfterLower,dropsBeforeUpper,dropsAfterUpper;
std::vector<ZoneData>endZones,upperEndZones; std::vector<ZoneData>endZones,upperEndZones;
std::vector<vf2d>circleCooldownPoints; std::vector<vf2d>circleCooldownPoints;
std::vector<vf2d>donutCircleCooldownPoints;
std::vector<vf2d>squareCircleCooldownPoints; std::vector<vf2d>squareCircleCooldownPoints;
std::map<std::string,TilesetData>MAP_TILESETS; std::map<std::string,TilesetData>MAP_TILESETS;
vf2d worldShake={}; vf2d worldShake={};

@ -90,4 +90,11 @@ void State_GameRun::Draw(AiL*game){
game->RenderWorld(game->GetElapsedTime()); game->RenderWorld(game->GetElapsedTime());
game->RenderHud(); game->RenderHud();
Tutorial::Draw(); Tutorial::Draw();
std::vector<vf2d>largeDonut{};
std::transform(game->donutCircleCooldownPoints.begin(),game->donutCircleCooldownPoints.end(),std::back_inserter(largeDonut),[](const vf2d&point){return vf2d{120,120}+point*64.f;});
game->SetDecalStructure(DecalStructure::STRIP);
game->DrawPolygonDecal(nullptr,largeDonut,largeDonut,RED);
game->SetDecalStructure(DecalStructure::FAN);
} }

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_PATCH 3 #define VERSION_PATCH 3
#define VERSION_BUILD 10827 #define VERSION_BUILD 10836
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

@ -586,7 +586,7 @@ namespace olc
// Pixel Game Engine Advanced Configuration // Pixel Game Engine Advanced Configuration
constexpr inline uint8_t nMouseButtons = 5; constexpr inline uint8_t nMouseButtons = 5;
constexpr inline uint8_t nTabSizeInSpaces = 4; constexpr inline uint8_t nTabSizeInSpaces = 4;
constexpr inline size_t OLC_MAX_VERTS = 128; constexpr inline size_t OLC_MAX_VERTS = 256;
enum rcode { FAIL = 0, OK = 1, NO_FILE = -1 }; enum rcode { FAIL = 0, OK = 1, NO_FILE = -1 };
// Thanks to scripticuk and others for updating the key maps // Thanks to scripticuk and others for updating the key maps
// NOTE: The GLUT platform will need updating, open to contributions ;) // NOTE: The GLUT platform will need updating, open to contributions ;)

Loading…
Cancel
Save