-
Notifications
You must be signed in to change notification settings - Fork 0
/
Textures.cpp
60 lines (50 loc) · 1.75 KB
/
Textures.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include "Textures.hpp"
Textures::Textures() {
if(!textureCharacter.loadFromFile("char.png"))
throw std::runtime_error("Cannot load texture.");
if(!enemyTexture.loadFromFile("zombie.png"))
throw std::runtime_error("Cannot load texture.");
if(!fireballTexture.loadFromFile("fireball.png"))
throw std::runtime_error("Cannot load texture.");
if(!coinTexture.loadFromFile("Coins16x16.png"))
throw std::runtime_error("Cannot load texture.");
if(!powerupTexture.loadFromFile("powerups.png"))
throw std::runtime_error("Cannot load texture.");
if(!healTexture.loadFromFile("GemsAndHearts.png"))
throw std::runtime_error("Cannot load texture.");
if(!wallTexture.loadFromFile("Back_002.png"))
throw std::runtime_error("Cannot load texture.");
if(!boxTexture.loadFromFile("Crate_001.png"))
throw std::runtime_error("Cannot load texture.");
if(!echoSlamTexture.loadFromFile("echoSlam.png"))
throw std::runtime_error("Cannot load texture.");
if(!tileTexture.loadFromFile("tile.png"))
throw std::runtime_error("Cannot load texture.");
}
sf::Texture& Textures::getTextureCharacter() {
return textureCharacter;
}
sf::Texture& Textures::getEnemyTexture() {
return enemyTexture;
}
sf::Texture& Textures::getFireballTexture() {
return fireballTexture;
}
sf::Texture& Textures::getCoinTexture() {
return coinTexture;
}
sf::Texture& Textures::getPowerupTexture() {
return powerupTexture;
}
sf::Texture& Textures::getHealTexture() {
return healTexture;
}
sf::Texture& Textures::getWallTexture() {
return wallTexture;
}
sf::Texture& Textures::getBoxTexture() {
return boxTexture;
}
sf::Texture& Textures::getEchoSlamTexture() {
return echoSlamTexture;
}