-
Notifications
You must be signed in to change notification settings - Fork 0
/
catris.h
62 lines (45 loc) · 1.03 KB
/
catris.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef __CATRIS_H
#define __CATRIS_H
#include "timer.h"
#include "graphics.h"
#include "font_data.h"
#include "sprite_data.h"
class Catris {
public:
enum Anim {
Happy,
Shocked,
Worried,
InLove,
LowBattery,
HighScore
};
Catris(fontDataReader fontDataReader, spriteDataReader spriteDataReader);
~Catris();
Anim getAnimation();
void setAnimation(Anim animation);
void setText(const char* text);
void setFormattedText(const char* format, ...);
bool update();
void draw(canvas canvas);
private:
fontDataReader _fontDataReader;
spriteDataReader _spriteDataReader;
Timer* _rainbowTimer;
Timer* _scrollTimer;
Timer* _animTimer;
ScrollText* _scrollText;
char* _buffer;
Anim _currentAnim;
Animation* _currentAnimation;
Animation* _happyAnimation;
Animation* _shockedAnimation;
Animation* _worriedAnimation;
Animation* _inLoveAnimation;
Animation* _lowBatteryAnimation;
Animation* _highScoreAnimation;
uint8_t _animFrame;
void _loadAnimation(Animation* animation);
void _playAnimation(canvas canvas);
};
#endif