commit de me ane cap a casa

This commit is contained in:
2024-10-28 13:51:26 +01:00
parent 2cffe8dfc9
commit 0fe371653a
4 changed files with 67 additions and 41 deletions

View File

@@ -919,7 +919,7 @@ void Game::createItemScoreSprite(int x, int y, std::shared_ptr<Texture> texture)
}
// Crea un objeto PathSprite
void Game::createPathSprite(SDL_Point start, SDL_Point end, std::shared_ptr<Texture> texture)
void Game::createPathSprite(std::shared_ptr<Texture> texture)
{
path_sprites_.emplace_back(std::make_unique<PathSprite>(texture));
@@ -930,7 +930,6 @@ void Game::createPathSprite(SDL_Point start, SDL_Point end, std::shared_ptr<Text
path_sprites_.back()->setWidth(w);
path_sprites_.back()->setHeight(h);
path_sprites_.back()->setSpriteClip({0, 0, w, h});
path_sprites_.back()->addVerticalPath(start, end, 50, 10);
path_sprites_.back()->enable();
}
@@ -1579,10 +1578,9 @@ void Game::checkEvents()
case SDLK_5: // Crea un PathSprite
{
const auto x = players_.at(0)->getPosX();
const SDL_Point start = {x, 200};
const SDL_Point end = {x, 170};
createPathSprite(start, end, game_text_textures_.at(3));
path_sprites_.back()->addVerticalPath({x,170}, {x,0}, 100, 1);
createPathSprite(game_text_textures_.at(3));
path_sprites_.back()->addVerticalPath({x,220}, {x,170}, 100, 5);
path_sprites_.back()->addVerticalPath({x,170}, {x,-20}, 120, 5);
break;
}
default: