nsnake
Classic snake game for the terminal
AnimationSnakes.hpp
1 #ifndef ANIMATIONSNAKES_H_DEFINED
2 #define ANIMATIONSNAKES_H_DEFINED
3 
4 #include <Interface/Animation/Animation.hpp>
5 #include <Misc/Timer.hpp>
6 
7 #include <vector>
8 
9 #define MAX_SNAKES 100
10 
11 struct LilSnake
12 {
13  int x;
14  int y;
15  int size;
16 
17  LilSnake(int x, int y, int size):
18  x(x),
19  y(y),
20  size(size)
21  { }
22 };
23 
26 {
27 public:
28  AnimationSnakes(Window* window);
29  virtual ~AnimationSnakes() {};
30 
31  void load();
32  void update();
33  void draw();
34 
35 private:
36  std::vector<LilSnake> lilsnakes;
37 
39  Timer updateTimer;
40 
42  Timer addTimer;
43 
44  void addSnake();
45 };
46 
47 #endif //ANIMATIONSNAKES_H_DEFINED
48 
A segment of the terminal screen (2D char matrix).
Definition: Window.hpp:16
Rules and behavior of the Fire animation.
Abstract interface to any kind of Animation.
Definition: Animation.hpp:7
Definition: Timer.hpp:7