nsnake
Classic snake game for the terminal
Toggle main menu visibility
Loading...
Searching...
No Matches
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
AnimationSnakes::update
void update()
Updates Animation's internal state.
Definition
AnimationSnakes.cpp:15
AnimationSnakes::load
void load()
Loads all internal things.
Definition
AnimationSnakes.cpp:8
AnimationSnakes::draw
void draw()
Shows Animation on the screen.
Definition
AnimationSnakes.cpp:57
Animation::Animation
Animation(Window *window)
Creates an Animation that will occur on window.
Definition
Animation.hpp:11
Timer
Definition
Timer.hpp:8
Window
A segment of the terminal screen (2D char matrix).
Definition
Window.hpp:17
Generated on
for nsnake by
1.17.0