forked from jaildesigner-jailgames/jaildoctors_dilemma
Corregido un bug con las colisiones entre un punto y una linea diagonal
This commit is contained in:
@@ -25,6 +25,8 @@ Room::Room(std::string file_path, SDL_Renderer *renderer, Screen *screen, Asset
|
||||
texture = new LTexture(renderer, asset->get(tileset));
|
||||
itemSound = JA_LoadSound(asset->get("item.wav").c_str());
|
||||
|
||||
debug->clearLog();
|
||||
debug->addToLog(tileset);
|
||||
// Calcula las superficies
|
||||
setBottomSurfaces();
|
||||
setTopSurfaces();
|
||||
@@ -43,6 +45,7 @@ Room::Room(std::string file_path, SDL_Renderer *renderer, Screen *screen, Asset
|
||||
|
||||
// Establece el color del borde
|
||||
screen->setBorderColor(borderColor);
|
||||
|
||||
}
|
||||
|
||||
// Destructor
|
||||
@@ -937,6 +940,7 @@ void Room::setLeftSlopes()
|
||||
line.x2 = ((lastOneFound % mapWidth) * tileSize) + tileSize - 1;
|
||||
line.y2 = ((lastOneFound / mapWidth) * tileSize) + tileSize - 1;
|
||||
leftSlopes.push_back(line);
|
||||
debug->addToLog("LS: " + std::to_string(line.x1) + "," + std::to_string(line.y1) + "," + std::to_string(line.x2) + "," + std::to_string(line.y2));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -978,6 +982,7 @@ void Room::setRightSlopes()
|
||||
line.x2 = (lastOneFound % mapWidth) * tileSize;
|
||||
line.y2 = ((lastOneFound / mapWidth) * tileSize) + tileSize - 1;
|
||||
rightSlopes.push_back(line);
|
||||
debug->addToLog("RS: " + std::to_string(line.x1) + "," + std::to_string(line.y1) + "," + std::to_string(line.x2) + "," + std::to_string(line.y2));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user