nsnake
Classic snake game for the terminal
Loading...
Searching...
No Matches
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
11struct 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
25class AnimationSnakes: public Animation
26{
27public:
28 AnimationSnakes(Window* window);
29 virtual ~AnimationSnakes() {};
30
31 void load();
32 void update();
33 void draw();
34
35private:
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
void update()
Updates Animation's internal state.
void load()
Loads all internal things.
void draw()
Shows Animation on the screen.
Animation(Window *window)
Creates an Animation that will occur on window.
Definition Animation.hpp:11
Definition Timer.hpp:8
A segment of the terminal screen (2D char matrix).
Definition Window.hpp:17