-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAssets.cpp
46 lines (38 loc) · 1.01 KB
/
Assets.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
#include "Assets.h"
#include "string"
void Assets::load()
{
const static std::string pathImage = "res\\img\\";
const static std::string pathFont = "res\\font\\";
const static std::string pathSound = "res\\sound\\";
if (!m_ship.loadFromFile(pathImage + "Ship.png")) throw;
if (!m_bullet.loadFromFile(pathImage + "BulletFish.png")) throw;
if (!m_catAsteroidSmall.loadFromFile(pathImage + "catAsteroidSmall.png")) throw;
if (!m_catAsteroidBig.loadFromFile(pathImage + "catAsteroidBig.png")) throw;
if (!m_hyperSpaceFont.loadFromFile(pathFont + "Hyperspace.otf")) throw;
if (!m_soundBufferFire.loadFromFile(pathSound + "Fire.wav")) throw;
}
sf::Image Assets::getBullet()
{
return m_bullet;
}
sf::Image Assets::getShip()
{
return m_ship;
}
sf::Image Assets::getCatAsteroidSmall()
{
return m_catAsteroidSmall;
}
sf::Image Assets::getCatAsteroidBig()
{
return m_catAsteroidBig;
}
sf::Font& Assets::getHyperspaceFont()
{
return m_hyperSpaceFont;
}
sf::SoundBuffer& Assets::getSoundBufferFire()
{
return m_soundBufferFire;
}