Mario: detect left/right collision
This commit is contained in:
+2
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user