-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnimation.h
57 lines (40 loc) · 956 Bytes
/
Animation.h
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
#ifndef ANIMATION_H
#define ANIMATION_H
#include"stdafx.h"
#include"Image.h"
namespace animation {
class Animation {
private:
img::ImageFile dynamicImg;
sf::Clock clock;
sf::IntRect intRect;
sf::SoundBuffer soundBuffer;
sf::Sound sound;
/*
if(!soundBuffer.loadFromFile("walk.wav"))
std::cout<< "can't find wav file" << std::endl;
sound.setBuffer(soundBuffer);
sound.setVolume(50);
sound.setLoop(true); // ¹«ÇÑ ¹Ýº¹
if(event.key.code == sf::keyboard::p)
sound.play();
*/
sf::Music music;
/*
if(!music.openFromFile("hero.ogg"))
std::cout<<"can't find ogg file " << std::endl;
if(event.key.code == sf::keyboard::p)
music.play();
*/
float deltaTime;
float totalTime;
float switchTime;
float row;
public:
Animation(float deltaTime, float totalTime, float switchTime);
~Animation();
void setImg(img::ImageFile img);
void update(float deltaTime);
};
}
#endif // ANIMATION_H