-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathResourceManager.cpp
118 lines (108 loc) · 5.36 KB
/
ResourceManager.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#include "ResourceManager.h"
sf::Font ResourceManager::ArialFont = sf::Font();
sf::Font ResourceManager::PixelFont = sf::Font();
sf::Texture ResourceManager::JohnStand = sf::Texture();
sf::Texture ResourceManager::JohnRun = sf::Texture();
sf::Texture ResourceManager::JohnAtt = sf::Texture();
sf::Texture ResourceManager::RoseStand = sf::Texture();
sf::Texture ResourceManager::RoseRun = sf::Texture();
sf::Texture ResourceManager::RoseAttPow = sf::Texture();
sf::Texture ResourceManager::DaveStand = sf::Texture();
sf::Texture ResourceManager::DaveRun = sf::Texture();
sf::Texture ResourceManager::DaveJump = sf::Texture();
sf::Texture ResourceManager::DaveAtt = sf::Texture();
sf::Texture ResourceManager::JadeStand = sf::Texture();
sf::Texture ResourceManager::JadeRun = sf::Texture();
sf::Texture ResourceManager::JadeAtt = sf::Texture();
sf::Texture ResourceManager::HealthOverlay = sf::Texture();
sf::Texture ResourceManager::HealthUnderlay = sf::Texture();
Animation ResourceManager::JohnRunAnim = Animation();
Animation ResourceManager::JohnAttAnim = Animation();
Animation ResourceManager::RoseRunAnim = Animation();
Animation ResourceManager::RoseAttPowAnim = Animation();
Animation ResourceManager::DaveRunAnim = Animation();
Animation ResourceManager::DaveAttAnim = Animation();
Animation ResourceManager::JadeRunAnim = Animation();
Animation ResourceManager::JadeAttAnim = Animation();
sf::SoundBuffer ResourceManager::SimpleBeep = sf::SoundBuffer();
sf::SoundBuffer ResourceManager::LightWhoosh = sf::SoundBuffer();
sf::SoundBuffer ResourceManager::HeavyWhoosh = sf::SoundBuffer();
sf::SoundBuffer ResourceManager::Thud = sf::SoundBuffer();
sf::SoundBuffer ResourceManager::GunShot = sf::SoundBuffer();
sf::Music ResourceManager::SongTemp;
void ResourceManager::initialize(){
//fonts
ArialFont.loadFromFile("arial.ttf");
PixelFont.loadFromFile("TYPOSTUCK.ttf");
//sprites
JohnStand.loadFromFile("Sprites/John_Stand.png");
JohnRun.loadFromFile("Sprites/John_Run.png");
JohnAtt.loadFromFile("Sprites/John_Attack.png");
RoseStand.loadFromFile("Sprites/Rose_Stand.png");
RoseRun.loadFromFile("Sprites/Rose_Run.png");
RoseAttPow.loadFromFile("Sprites/Rose_Attack_Pow.png");
DaveStand.loadFromFile("Sprites/Dave_Stand.png");
DaveRun.loadFromFile("Sprites/Dave_Run.png");
DaveJump.loadFromFile("Sprites/Dave_Jump.png");
DaveAtt.loadFromFile("Sprites/Dave_Attack.png");
JadeStand.loadFromFile("Sprites/Jade_Stand.png");
JadeRun.loadFromFile("Sprites/Jade_Run.png");
JadeAtt.loadFromFile("Sprites/Jade_Attack.png");
HealthOverlay.loadFromFile("Sprites/Health_Overlay.png");
HealthUnderlay.loadFromFile("Sprites/Health_Underlay.png");
//animations
JohnRunAnim.setSpriteSheet(JohnRun);
JohnRunAnim.addFrame(sf::IntRect(41,60,260,230));
JohnRunAnim.addFrame(sf::IntRect(376,60,260,230));
JohnRunAnim.addFrame(sf::IntRect(723,60,260,230));
JohnRunAnim.addFrame(sf::IntRect(1037,60,260,230));
JohnAttAnim.setSpriteSheet(JohnAtt);
JohnAttAnim.addFrame(sf::IntRect(90,35,370,270));
JohnAttAnim.addFrame(sf::IntRect(601,35,370,270));
JohnAttAnim.addFrame(sf::IntRect(1134,35,370,270));
JohnAttAnim.addFrame(sf::IntRect(1695,35,370,270));
JohnAttAnim.addFrame(sf::IntRect(2184,35,370,270));
JohnAttAnim.addFrame(sf::IntRect(2645,35,370,270));
RoseRunAnim.setSpriteSheet(RoseRun);
RoseRunAnim.addFrame(sf::IntRect(40,55,160,230));
RoseRunAnim.addFrame(sf::IntRect(205,55,160,230));
RoseRunAnim.addFrame(sf::IntRect(365,55,160,230));
RoseRunAnim.addFrame(sf::IntRect(205,55,160,230));
RoseAttPowAnim.setSpriteSheet(RoseAttPow);
RoseAttPowAnim.addFrame(sf::IntRect(271,25,380,230));
RoseAttPowAnim.addFrame(sf::IntRect(785,25,380,230));
RoseAttPowAnim.addFrame(sf::IntRect(1250,25,380,230));
RoseAttPowAnim.addFrame(sf::IntRect(1704,25,380,230));
RoseAttPowAnim.addFrame(sf::IntRect(2113,25,380,230));
RoseAttPowAnim.addFrame(sf::IntRect(2580,25,380,230));
DaveRunAnim.setSpriteSheet(DaveRun);
DaveRunAnim.addFrame(sf::IntRect(60,60,210,240));
DaveRunAnim.addFrame(sf::IntRect(290,60,210,240));
DaveRunAnim.addFrame(sf::IntRect(520,60,210,240));
DaveRunAnim.addFrame(sf::IntRect(290,60,210,240));
DaveAttAnim.setSpriteSheet(DaveAtt);
DaveAttAnim.addFrame(sf::IntRect(93,50,425,260));
DaveAttAnim.addFrame(sf::IntRect(632,50,425,260));
DaveAttAnim.addFrame(sf::IntRect(1056,50,425,260));
DaveAttAnim.addFrame(sf::IntRect(1529,50,425,260));
DaveAttAnim.addFrame(sf::IntRect(1990,50,425,260));
DaveAttAnim.addFrame(sf::IntRect(2506,50,425,260));
JadeRunAnim.setSpriteSheet(JadeRun);
JadeRunAnim.addFrame(sf::IntRect(60,60,165,265));
JadeRunAnim.addFrame(sf::IntRect(290,60,165,265));
JadeRunAnim.addFrame(sf::IntRect(520,60,165,265));
JadeRunAnim.addFrame(sf::IntRect(290,60,165,265));
JadeAttAnim.setSpriteSheet(JadeAtt);
JadeAttAnim.addFrame(sf::IntRect(114,40,490,240));
JadeAttAnim.addFrame(sf::IntRect(710,40,490,240));
JadeAttAnim.addFrame(sf::IntRect(1416,40,490,240));
//sounds
SimpleBeep.loadFromFile("Sounds/SimpleBeep.wav");
LightWhoosh.loadFromFile("Sounds/LightWhoosh.wav");
HeavyWhoosh.loadFromFile("Sounds/HeavyWhoosh.wav");
Thud.loadFromFile("Sounds/HammerThud.wav");
GunShot.loadFromFile("Sounds/GunShot.wav");
//music
SongTemp.openFromFile("Sounds/SongTemp.wav");
SongTemp.setLoop(true);
}