Ajout de carte basique en binaire

This commit is contained in:
YANNIS
2025-05-31 16:08:45 +02:00
parent cfe9fc856a
commit 3b05a7e4e9
3 changed files with 17 additions and 9 deletions
+12 -8
View File
@@ -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<int> row(10, static_cast<int>(Element::MUR));
for (int i = 0; i < 11; ++i) {
if (i == 0 || i == 10) {
std::vector<int> row(11, static_cast<int>(Element::MUR));
_tiles.push_back(row);
break;
}
else if (i % 2 == 1) {
else if (i % 2 == 0) {
std::vector <int> 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<int>(Element::MUR));
else if (j % 2 == 0)
row.push_back(static_cast<int>(Element::MUR));
else
row.push_back(static_cast<int>(Element::SOL));
}
_tiles.push_back(row);
}
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);
}
}
+3
View File
@@ -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)) {
+1
View File
@@ -1,6 +1,7 @@
#pragma once
#include <SDL2/SDL.h>
#include <iostream>
#include "Carte_Basique.hpp"
class Game {
private: