Mario: detect left/right collision

This commit is contained in:
2021-04-29 12:33:31 +02:00
parent e8e9e12b58
commit b611e2479a
5 changed files with 19 additions and 11 deletions
+2 -2
View File
@@ -56,10 +56,10 @@ void loadMap(std::shared_ptr<SDLPP::Scene> &scene, std::shared_ptr<SDLPP::Rectan
std::getline(mapFile, buffer);
auto mario_y = std::stoi(buffer);
auto cur_y = 1 - rows * BLOCK_SIZE;
for(size_t i = 0; i < rows; i++) {
for(int i = 0; i < rows; i++) {
std::getline(mapFile, buffer);
auto cur_x = -BLOCK_SIZE;
for(size_t j = 0; j < cols; j++) {
for(int j = 0; j < cols; j++) {
cur_x += BLOCK_SIZE;
if(buffer[j] == ' ')
continue;