nsnake
Classic snake game for the terminal
AnimationWater.hpp
1 #ifndef ANIMATIONWATER_H_DEFINED
2 #define ANIMATIONWATER_H_DEFINED
3 
4 #include <Engine/Graphics/Animation.hpp>
5 #include <Engine/Helpers/Array2D.hpp>
6 #include <Engine/Helpers/Timer.hpp>
7 
8 #include <vector>
9 
10 // Height of the Water
11 #define HEIGHT_MIN 0
12 #define HEIGHT_MAX 100
13 
15 #define HEIGHT_PERCENT(x) \
16  (x * (100/(HEIGHT_MAX - HEIGHT_MIN)))
17 
19 class AnimationWater: public Animation
20 {
21 public:
22  AnimationWater(Window* window);
23  virtual ~AnimationWater();
24 
25  void load();
26  void update();
27  void draw();
28 
29 private:
30  Array2D<int>* buffer1;
31  Array2D<int>* buffer2;
32 
33  Timer timer;
34 };
35 
36 #endif //ANIMATIONWATER_H_DEFINED
37 
Rules and behavior of the Water animation.