Donut circle cooldown indicator test code.

mac-build
sigonasr2 6 months ago
parent 7fa02b0f7a
commit 97a9025830
  1. 24
      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,13 +3673,23 @@ void AiL::InitializeGraphics(){
squareCircleCooldownPoints.push_back({0,0});
for(int i=0;i<=360;i+=4){
float angle=util::degToRad(float(i))-PI/2;
if(i==0){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);
point.x=std::clamp(point.x,-1.f,1.f);
point.y=std::clamp(point.y,-1.f,1.f);
if(i==0){squareCircleCooldownPoints.push_back(point);}
squareCircleCooldownPoints.push_back(point);
#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)});}
circleCooldownPoints.push_back(vf2d{cos(angle),sin(angle)});
vf2d point=vf2d{cos(angle),sin(angle)}*sqrt(2.1f);
point.x=std::clamp(point.x,-1.f,1.f);
point.y=std::clamp(point.y,-1.f,1.f);
if(i==0){squareCircleCooldownPoints.push_back(point);}
squareCircleCooldownPoints.push_back(point);
#pragma endregion
}
for(auto&val:DATA["Images"].GetKeys()){

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

@ -90,4 +90,11 @@ void State_GameRun::Draw(AiL*game){
game->RenderWorld(game->GetElapsedTime());
game->RenderHud();
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_MINOR 2
#define VERSION_PATCH 3
#define VERSION_BUILD 10827
#define VERSION_BUILD 10836
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -586,7 +586,7 @@ namespace olc
// Pixel Game Engine Advanced Configuration
constexpr inline uint8_t nMouseButtons = 5;
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 };
// Thanks to scripticuk and others for updating the key maps
// NOTE: The GLUT platform will need updating, open to contributions ;)

Loading…
Cancel
Save