From fb65cc3613f659d7e7dae52128ab82df5b65fa3d Mon Sep 17 00:00:00 2001 From: Askou Date: Fri, 4 Jun 2021 14:42:57 +0200 Subject: [PATCH] fix bumper position --- sources/Map/Map.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/Map/Map.cpp b/sources/Map/Map.cpp index c83b32ca..946c3122 100644 --- a/sources/Map/Map.cpp +++ b/sources/Map/Map.cpp @@ -68,7 +68,7 @@ namespace BBM for (int i = 0; i < width + 1; i++) { for (int j = 0; j < height + 1; j++) { - if (map[std::make_tuple(i, 0, j)] != HOLE && map[std::make_tuple(i, 0, j)] != BUMPER) + if (map[std::make_tuple(i, 0, j)] != HOLE && map[std::make_tuple(i, -1, j)] != BUMPER) scene->addEntity("Unbreakable Wall") .addComponent(Vector3f(i, -1, j)) //.addComponent(1) @@ -222,8 +222,8 @@ namespace BBM map[std::make_tuple(0, 0, 1)] = STAIRS; map[std::make_tuple(width, 0, height - 1)] = STAIRS; map[std::make_tuple(width, 0, 1)] = STAIRS; - map[std::make_tuple(width / 2, 0, height - 1)] = BUMPER; - map[std::make_tuple(width / 2, 0, 1)] = BUMPER; + map[std::make_tuple(width / 2, -1, height - 1)] = BUMPER; + map[std::make_tuple(width / 2, -1, 1)] = BUMPER; } if (rnd > 0.30) { std::cout << "Up center" << std::endl; @@ -303,7 +303,7 @@ namespace BBM generateFloor(map, width, height, scene); for (int x = 0; x < width + 1; x++) for (int z = 0; z < height + 1; z++) - for (int y = 0; y < 1 + 1; y++) + for (int y = -1; y < 1 + 1; y++) createElement(Vector3f(x, y, z), scene, map[std::make_tuple(x, y, z)]); }