Ajout de carte basique en binaire
This commit is contained in:
+12
-8
@@ -5,23 +5,27 @@ Carte_Basique::Carte_Basique() {
|
|||||||
_titre = "Carte Basique";
|
_titre = "Carte Basique";
|
||||||
_auteur = "nullEd";
|
_auteur = "nullEd";
|
||||||
_description = "Description de la carte basique";
|
_description = "Description de la carte basique";
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 11; ++i) {
|
||||||
if (i == 0 || i == 9) {
|
if (i == 0 || i == 10) {
|
||||||
std::vector<int> row(10, static_cast<int>(Element::MUR));
|
std::vector<int> row(11, static_cast<int>(Element::MUR));
|
||||||
_tiles.push_back(row);
|
_tiles.push_back(row);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else if (i % 2 == 1) {
|
else if (i % 2 == 0) {
|
||||||
std::vector <int> row;
|
std::vector <int> row;
|
||||||
for (int j = 0; j < 10; ++j) {
|
for (int j = 0; j < 11; ++j) {
|
||||||
if (j % 2 == 0)
|
if (j == 0 || j == 10)
|
||||||
|
row.push_back(static_cast<int>(Element::MUR));
|
||||||
|
else if (j % 2 == 0)
|
||||||
row.push_back(static_cast<int>(Element::MUR));
|
row.push_back(static_cast<int>(Element::MUR));
|
||||||
else
|
else
|
||||||
row.push_back(static_cast<int>(Element::SOL));
|
row.push_back(static_cast<int>(Element::SOL));
|
||||||
}
|
}
|
||||||
|
_tiles.push_back(row);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
std::vector<int> row(10, static_cast<int>(Element::SOL));
|
std::vector<int> row(11, static_cast<int>(Element::SOL));
|
||||||
|
row[0] = static_cast<int>(Element::MUR);
|
||||||
|
row[10] = static_cast<int>(Element::MUR);
|
||||||
_tiles.push_back(row);
|
_tiles.push_back(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ Game::~Game() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Game::Run() {
|
void Game::Run() {
|
||||||
|
Carte_Basique carte;
|
||||||
|
std::cout << carte << std::endl;
|
||||||
|
//Main game loop
|
||||||
while (_isRunning) {
|
while (_isRunning) {
|
||||||
//Handle events
|
//Handle events
|
||||||
while (SDL_PollEvent(&_event)) {
|
while (SDL_PollEvent(&_event)) {
|
||||||
@@ -51,7 +54,7 @@ void Game::Run() {
|
|||||||
SDL_RenderClear(_renderer);
|
SDL_RenderClear(_renderer);
|
||||||
|
|
||||||
//Render game objects here
|
//Render game objects here
|
||||||
|
|
||||||
//Update the screen
|
//Update the screen
|
||||||
SDL_RenderPresent(_renderer);
|
SDL_RenderPresent(_renderer);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user