diff --git a/TODO b/TODO index db57953..5753d44 100644 --- a/TODO +++ b/TODO @@ -11,8 +11,8 @@ [x] Better player spritesheet [x] Animation system [x] Sound -[ ] Enemies / AI -[ ] Dungeon fixed entity spawning -[ ] Enemy AI -[ ] Gameplay +[x] Enemies / AI +[x] Dungeon fixed entity spawning +[x] Enemy AI +[ ] Gameplay - Enemies can't survive the dark diff --git a/The Great Machine/Dungeon.cpp b/The Great Machine/Dungeon.cpp index 376c2df..791f483 100644 --- a/The Great Machine/Dungeon.cpp +++ b/The Great Machine/Dungeon.cpp @@ -495,7 +495,7 @@ void Dungeon::Update(olc::PixelGameEngine* engine, float fTime) olc::vf2d desiredLocation = Player->Coords; for (auto enemy : Enemies) { - enemy->Velocity = static_cast(TileSize) * (fTime * (Player->Speed / 3.0f) * olc::vf2d(desiredLocation - enemy->Coords).norm()); + enemy->Velocity = static_cast(TileSize) * (fTime * (Player->Speed / 1.5f) * olc::vf2d(desiredLocation - enemy->Coords).norm()); enemy->Coords += enemy->Velocity; } @@ -538,7 +538,6 @@ void Dungeon::Draw(olc::PixelGameEngine* engine, float fTime) for (int i = 0; i < Enemies.size(); i++) { - _Logger.Debug(i); Enemies[i]->Animator->SetState("idle"); Enemies[i]->Animator->Draw(fTime, {Enemies[i]->Coords.x - ActiveCamera->Coords.x, Enemies[i]->Coords.y - ActiveCamera->Coords.y}); } diff --git a/The Great Machine/main.cpp b/The Great Machine/main.cpp index ce61ecc..218e4ff 100644 --- a/The Great Machine/main.cpp +++ b/The Great Machine/main.cpp @@ -51,7 +51,8 @@ class Game : public olc::PixelGameEngine SetDrawTarget(uint8_t(0)); Clear(olc::BLANK); - goto bruh; + + // goto bruh; if (_TimeAccumilator < 6.0f) { @@ -88,15 +89,19 @@ class Game : public olc::PixelGameEngine _DeltaFade1 -= fTime * 200.0f; if (_DeltaFade1 < 0.1f) _DeltaFade1 = 0.0f; } - + // TODO: Center these omd SetPixelMode(olc::Pixel::ALPHA); if (_TimeAccumilator > 16.0f) - DrawString((ScreenWidth() / 2) - (7 * 3) * (std::string("the machine has done nothing for me").length() / 2), 40, "the machine has done nothing for me", olc::Pixel(255, 255, 255, static_cast(_DeltaFade1)), 3); + DrawString((ScreenWidth() / 2) - (7 * 4) * (std::string("the machine has done nothing for me").length() / 2), 40, "the machine has done nothing for me", olc::Pixel(255, 255, 255, static_cast(_DeltaFade1)), 3); if (_TimeAccumilator > 20.0f) - DrawString((ScreenWidth() / 2) - (7 * 3) * (std::string("the machine has left me with nothing").length() / 2), 120, "the machine has left me with nothing", olc::Pixel(255, 255, 255, static_cast(_DeltaFade1)), 3); + DrawString((ScreenWidth() / 2) - (7 * 4) * (std::string("the machine has left me with nothing").length() / 2), 120, "the machine has left me with nothing", olc::Pixel(255, 255, 255, static_cast(_DeltaFade1)), 3); if (_TimeAccumilator > 23.0f) - DrawString((ScreenWidth() / 2) - (7 * 5) * (std::string("i am nothing").length() / 2), 300, "i am nothing", olc::Pixel(255, 255, 255, static_cast(_DeltaFade1)), 5); + + DrawString((ScreenWidth() / 2) - (7 * 7) * (std::string("i am nothing").length() / 2), 300, "i am nothing", olc::Pixel(255, 255, 255, static_cast(_DeltaFade1)), 6); + if (_TimeAccumilator > 25.0f) + DrawString((ScreenWidth() / 2) - (7 * 3) * (std::string("your demons can't survive the dark").length() / 2), 650, "your demons can't survive the dark", olc::Pixel(255, 255, 255, static_cast(_DeltaFade1)), 2); } + } if (_TimeAccumilator > 26.0f) @@ -116,7 +121,7 @@ class Game : public olc::PixelGameEngine EnableLayer(i, true); return true; - } + } bool OnUserDestroy() override { @@ -125,9 +130,9 @@ class Game : public olc::PixelGameEngine } private: - long float _TimeAccumilator = 0.0f; + long float _TimeAccumilator = 0.0f; - float _DeltaFade = 255.0f; + float _DeltaFade = 255.0f; float _DeltaFade1 = 255.0f; };