-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnimation.hpp
executable file
·53 lines (43 loc) · 1.01 KB
/
Animation.hpp
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
#ifndef ANIMATION_HPP_INCLUDED
#define ANIMATION_HPP_INCLUDED
#include <iostream>
#include <map>
#include <string>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
//class Animation
//{
// public:
// Animation(int startFrame, int endFrame, float duration)
// :m_startFrame(startFrame), m_endFrame(endFrame),m_duration(duration)
// {};
// ~Animation(){};
//
// int m_startFrame;
// int m_endFrame;
// float m_duration;
//
// private:
//
//};
class AnimationComponent
{
//std::vector<Animation> m_animations;
public :
sf::IntRect m_currentBound;
sf::IntRect m_startBound;
int m_currentID;
int m_maxID;
AnimationComponent(int maxID, float animSpeed, int width, int height);
//void play();
void update(float& dt);
//void pause();
//void reset();
private:
float m_duration; //since new frame
int m_width;
int m_height;
float m_timer = 6.0f;//since beginning animation
};
#endif // ANIMATION_HPP_INCLUDED