From bdabd5a0bc003bcaa2fd381fd6c7927b0460fc34 Mon Sep 17 00:00:00 2001 From: DarthMooMancer <107283522+DarthMooMancer@users.noreply.github.com> Date: Wed, 29 Oct 2025 15:43:19 -0400 Subject: [PATCH] fixes --- src/main.cpp | 20 ++------------------ src/maps.cpp | 5 +++++ src/scheduler.cpp | 2 +- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 695e6ed..1096360 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,11 +1,7 @@ #include #include -#include -#include #include #include -#include -#include #include #include #include @@ -41,14 +37,6 @@ int main() { player_data.dash_distance, sf::Color::Black, sf::Color::White }; - Entity enemy { - { TILESIZE / 2.0f, TILESIZE / 2.0f }, - { TILESIZE * 5, TILESIZE * 3 }, - { 0, 0 }, - -1.0f, - sf::Color::Red - }; - sf::RenderWindow window(sf::VideoMode({WIDTH, HEIGHT}), "SFML window", sf::Style::Default); window.setFramerateLimit(FPS); @@ -63,7 +51,7 @@ int main() { bool running = true; std::thread player_dash_cooldown([&] { time.update_timers(running, player.timers); } ); - // sf::View view1(sf::FloatRect({000.f, 000.f}, {WIDTH + (TILESIZE * 3), HEIGHT + (TILESIZE * 3)})); + while (window.isOpen()) { window.clear(sf::Color::Black); text.setString(std::to_string(player.timers.dash_cooldown)); @@ -73,6 +61,7 @@ int main() { window.close(); } } + if(sf::Keyboard::isKeyPressed(sf::Keyboard::Key::Escape)) { running = false; window.close(); @@ -97,7 +86,6 @@ int main() { } } - // Handle Horizontal movement and collisions player.handle_movment(); player.get_horizontal_collision(wall_list); @@ -109,22 +97,18 @@ int main() { player.get_vertical_top_collision(wall_list); } - // Drawing Everything to window #ifdef __APPLE__ for(auto[i, j] : ranges::views::cartesian_product(ranges::views::iota(0, MAX_ROWS), ranges::views::iota(0, MAX_COLS))) { if(wall_list[i][j] == nullptr) continue; window.draw(wall_list[i][j]->rect); } #else - for(auto[i, j] : std::views::cartesian_product(std::views::iota(0, MAX_ROWS), std::views::iota(0, MAX_COLS))) { if(wall_list[i][j] == nullptr) continue; window.draw(wall_list[i][j]->rect); } #endif - // window.setView(view1); window.draw(player.rect); - window.draw(enemy.rect); window.draw(text); window.display(); } diff --git a/src/maps.cpp b/src/maps.cpp index 0abe81c..e142a36 100644 --- a/src/maps.cpp +++ b/src/maps.cpp @@ -22,6 +22,11 @@ void clear_map(Entity* wall_list[MAX_ROWS][MAX_COLS]) { #endif } +void create_map() { + char output[MAX_ROWS][MAX_COLS] = {}; + +} + void load_map(Entity* wall_list[MAX_ROWS][MAX_COLS], const char map_data[MAX_ROWS][MAX_COLS]) { #ifdef __APPLE__ for(auto[i, j] : ranges::views::cartesian_product(ranges::views::iota(0, MAX_ROWS), ranges::views::iota(0, MAX_COLS))) { diff --git a/src/scheduler.cpp b/src/scheduler.cpp index 0c58811..4efbe66 100644 --- a/src/scheduler.cpp +++ b/src/scheduler.cpp @@ -1,5 +1,5 @@ // timer for player cooldown -// + #include "scheduler.hpp" #include #include