From bbe33e438fb9d5b101ef1de6f79169e33d962e16 Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Fri, 7 Jan 2022 18:02:00 +0100 Subject: amazing interface man. good JOB --- meta/maps/stage_2_start.bfm | 3 +++ src/main.cpp | 37 ++++++++++++++++++++++++++----------- 2 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 meta/maps/stage_2_start.bfm diff --git a/meta/maps/stage_2_start.bfm b/meta/maps/stage_2_start.bfm new file mode 100644 index 0000000..c03609f --- /dev/null +++ b/meta/maps/stage_2_start.bfm @@ -0,0 +1,3 @@ +BOSS 0 0 +ENEMIES 120 20 +NEXT stage_1_1.bfm diff --git a/src/main.cpp b/src/main.cpp index 009ff9a..da25933 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -10,18 +10,32 @@ #include "window.hpp" #include "gameplay.hpp" #include -#include -#include +#include // basic libs + +#include +#include // additional libs gameState gs = TITLE; +std::map pick; int main(void) { initWindow(); + InitWindow(SCREENWIDTH, SCREENHEIGHT, "WIP -- muchashooter THRESHOLD"); + auto nPick = 0; - // Main game loop - InitWindow(SCREENWIDTH, SCREENHEIGHT, "WIP -- coolspace"); Game* game = nullptr; + + std::string path = "../meta/maps"; + int i = 0; + for (const auto & entry : std::filesystem::directory_iterator(path)) { // c++17 lol + if (entry.path().filename().generic_string().find("start") != std::string::npos) + { + pick[i] = entry.path().filename().generic_string(); + } + i++; + } + // Main game loop while (!WindowShouldClose()) /* Detect window close button or ESC key */ { switch (gs) { @@ -42,7 +56,7 @@ int main(void) { } if (IsKeyPressed(KEY_DOWN)) { - // pick++ + nPick++; } } case (GAMEPLAY): @@ -94,16 +108,17 @@ int main(void) { } case (PICK): { - std::string path = "../meta/maps"; - int i = 0; DrawRectangle(200, 100, 1200, 700, RAYWHITE); DrawRectangle(250, 150, 1100, 600, COOLPURPLE); DrawRectangle(300, 200, 1000, 500, RAYWHITE); - for (const auto & entry : std::filesystem::directory_iterator(path)) { - DrawText("TEST", SCREENWIDTH / 2, (SCREENHEIGHT / 2) + i * 40, 40, COOLPURPLE); - i++; - } DrawText("THRESHOLD", 260, 160, 30, RAYWHITE); + + for (auto n = 0 ; n < pick.size(); n++) + { + DrawText(pick[n].c_str(), SCREENWIDTH / 2, + (SCREENHEIGHT / 2) + n * 40, 40, COOLPURPLE); + } + break ; } case (GAMEPLAY): -- cgit v1.2.3