diff --git a/Carte_Basique.cpp b/Carte_Basique.cpp index 7708fd4..1212a5f 100644 --- a/Carte_Basique.cpp +++ b/Carte_Basique.cpp @@ -5,23 +5,27 @@ Carte_Basique::Carte_Basique() { _titre = "Carte Basique"; _auteur = "nullEd"; _description = "Description de la carte basique"; - for (int i = 0; i < 10; ++i) { - if (i == 0 || i == 9) { - std::vector row(10, static_cast(Element::MUR)); + for (int i = 0; i < 11; ++i) { + if (i == 0 || i == 10) { + std::vector row(11, static_cast(Element::MUR)); _tiles.push_back(row); - break; } - else if (i % 2 == 1) { + else if (i % 2 == 0) { std::vector row; - for (int j = 0; j < 10; ++j) { - if (j % 2 == 0) + for (int j = 0; j < 11; ++j) { + if (j == 0 || j == 10) + row.push_back(static_cast(Element::MUR)); + else if (j % 2 == 0) row.push_back(static_cast(Element::MUR)); else row.push_back(static_cast(Element::SOL)); } + _tiles.push_back(row); } else { - std::vector row(10, static_cast(Element::SOL)); + std::vector row(11, static_cast(Element::SOL)); + row[0] = static_cast(Element::MUR); + row[10] = static_cast(Element::MUR); _tiles.push_back(row); } } diff --git a/Game.cpp b/Game.cpp index 3a3f89e..c901e6d 100644 --- a/Game.cpp +++ b/Game.cpp @@ -38,6 +38,9 @@ Game::~Game() { } void Game::Run() { + Carte_Basique carte; + std::cout << carte << std::endl; + //Main game loop while (_isRunning) { //Handle events while (SDL_PollEvent(&_event)) { @@ -51,7 +54,7 @@ void Game::Run() { SDL_RenderClear(_renderer); //Render game objects here - + //Update the screen SDL_RenderPresent(_renderer); } diff --git a/Game.hpp b/Game.hpp index 284edf0..7b1ddff 100644 --- a/Game.hpp +++ b/Game.hpp @@ -1,6 +1,7 @@ #pragma once #include #include +#include "Carte_Basique.hpp" class Game { private: