nsnake
Classic snake game for the terminal
src
Interface
Animation
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
25
class
AnimationSnakes
:
public
Animation
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
Window
A segment of the terminal screen (2D char matrix).
Definition:
Window.hpp:17
AnimationSnakes::draw
void draw()
Shows Animation on the screen.
Definition:
AnimationSnakes.cpp:57
AnimationSnakes::update
void update()
Updates Animation's internal state.
Definition:
AnimationSnakes.cpp:15
Timer
Definition:
Timer.hpp:8
LilSnake
Definition:
AnimationSnakes.hpp:12
Animation
Abstract interface to any kind of Animation.
Definition:
Animation.hpp:8
AnimationSnakes::load
void load()
Loads all internal things.
Definition:
AnimationSnakes.cpp:8
AnimationSnakes
Rules and behavior of the Fire animation.
Definition:
AnimationSnakes.hpp:26
Generated on Tue Jul 28 2020 00:00:00 for nsnake by
1.8.18