Adding loadTextures to world and paths to textures to constants

This commit is contained in:
PolishPigeon 2022-01-24 10:50:31 +01:00 committed by KRZYSZTOF RUDNICKI
parent 49472ea32a
commit c3907aba60
5 changed files with 12 additions and 1 deletions

View File

@ -14,6 +14,7 @@ namespace Textures // This gives us a scope for the enumerators which allows us
{
Eagle,
Raptor,
Desert
};
}

View File

@ -19,9 +19,16 @@ World::World(sf::RenderWindow& window)
, mScrollSpeed ( WORLD_SCROLL_SPEED )
, mPlayerAircraft(nullptr)
{
// loadTextures();
loadTextures();
// buildScene();
// mWorldView.setCenter(mSpawnPosition);
}
void World::loadTextures()
{
mTextures.load(Textures::Eagle, PATH_TO_EAGLE_TEXTURE);
mTextures.load(Textures::Raptor, PATH_TO_RAPTOR_TEXTURE);
mTextures.load(Textures::Desert, PATH_TO_DESERT_TEXTURE);
}
#endif // WORLD_CPP

Binary file not shown.

View File

@ -5,6 +5,9 @@
// Paths
const std::string PATH_TO_PLAYER_TEXTURE = "Textures/Player.png";
const std::string PATH_TO_EAGLE_TEXTURE = "Textures/Eagle.png";
const std::string PATH_TO_RAPTOR_TEXTURE = "Textures/Raptor.png";
const std::string PATH_TO_DESERT_TEXTURE = "Textures/Desert.png";
// Player constants
const float PLAYER_RADIUS = 40;

Binary file not shown.