diff --git a/build-debug/sfml-test b/build-debug/sfml-test index a1933ef..8526bc1 100755 Binary files a/build-debug/sfml-test and b/build-debug/sfml-test differ diff --git a/build-release/sfml-test b/build-release/sfml-test index 4ebf91f..3579dac 100755 Binary files a/build-release/sfml-test and b/build-release/sfml-test differ diff --git a/src/game.cpp b/src/game.cpp index 686c098..3114655 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -20,16 +20,16 @@ Game::Game() main_window.create(sf::VideoMode(window_side * 3, window_side * 3), "SFML-Test Application", sf::Style::Default); main_window.setActive(); - - level->mapArray()[0][0]->setHeightShift(15); - level->mapArray()[0][1]->setHeightShift(10); + main_window.setFramerateLimit(60); current_level = 1; - //loadLevel(current_level); } int Game::run() { + // Initial level rendering + renderMap(); + // On the game loop while (main_window.isOpen()) { @@ -44,12 +44,12 @@ int Game::run() { // Move onMoving(event.key.code); + + // Probably something changed! Re-render + renderMap(); } } - // Draw level - renderMap(); - main_window.display(); } @@ -118,6 +118,11 @@ void Game::renderMap() float painter_x = 60, painter_y = 60; float horizontal_shift = 0, vertical_shift = 0; + sf::RectangleShape background_brush({static_cast(main_window.getSize().x), static_cast(main_window.getSize().y)}); + background_brush.setFillColor(palette::Black); + background_brush.setPosition(0.f, 0.f); + main_window.draw(background_brush); + // Brush for cell sprites sf::ConvexShape convex_brush; convex_brush.setPointCount(4);