Roguelike
 All Classes Namespaces Functions Variables Typedefs Friends Pages
animation.h
1 
22 #ifndef __ANIMATION_H
23 #define __ANIMATION_H
24 
25 #include <vector>
26 #include <iostream>
27 #include <frame.h>
28 #include <actor.h>
29 
33 class Animation
34 {
35  private:
39  std::vector<Frame> frames;
40 
45 
50 
55  long current_ms;
56 
60  int x;
61 
65  int y;
66 
70  int chunk_x;
71 
75  int chunk_y;
76 
80  bool done;
81 
82  public:
86  Animation(std::vector<Frame> _frames, int frame_rate, int _x, int _y, int chunk_x, int chunk_y);
87 
91  Animation(int frame_rate, int num_frames, int _x, int _y, int chunk_x, int chunk_y);
92 
96  Animation();
97 
102  void step(long ms);
103 
107  Frame get_frame();
108 
113  void add_frame(Frame new_frame, int location);
114 
118  int frame_rate();
119 
123  void new_frame(Frame new_frame);
124 
128  void add_actor_to_frame(Actor actor, int frame);
129 
133  bool get_done();
134  int get_x();
135  int get_y();
136  int get_chunk_x();
137  int get_chunk_y();
138 };
139 
140 #endif
bool done
Definition: animation.h:80
int chunk_x
Definition: animation.h:70
std::vector< Frame > frames
Definition: animation.h:39
void step(long ms)
Definition: animation.cpp:55
bool get_done()
Definition: animation.cpp:101
int current_frame
Definition: animation.h:44
Frame get_frame()
Definition: animation.cpp:70
void new_frame(Frame new_frame)
Definition: animation.cpp:75
int x
Definition: animation.h:60
Animation()
Definition: animation.cpp:51
int chunk_y
Definition: animation.h:75
void add_actor_to_frame(Actor actor, int frame)
Definition: animation.cpp:88
int ms_per_frame
Definition: animation.h:49
int y
Definition: animation.h:65
Definition: actor.h:30
Definition: frame.h:32
Definition: animation.h:33
int frame_rate()
Definition: animation.cpp:96
void add_frame(Frame new_frame, int location)
Definition: animation.cpp:80
long current_ms
Definition: animation.h:55