-
Notifications
You must be signed in to change notification settings - Fork 2
/
termosaur.hpp
86 lines (74 loc) · 1.4 KB
/
termosaur.hpp
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/**
*
* A terminal game:
*
* | |_ ___ _ __ _ __ ___ ___ ___ __ _ _ _ _ __
* | __/ _ \ '__| '_ ` _ \ / _ \/ __|/ _` | | | | '__|
* | || __/ | | | | | | | (_) \__ \ (_| | |_| | |
* \__\___|_| |_| |_| |_|\___/|___/\__,_|\__,_|_|
*
*
* Home
* https://github.com/b37t1td/termosaur
*
* Author
* Lady Int3gra
*
* Made with
* Love
*
* GNU GENERAL PUBLIC LICENSE
* Version 3, 29 June 2007
*
* Copyright (C) Lady Int3gra <https://github.io/int3gra>
*
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*
*/
#ifndef _TERMOSAUR_H
#define _TERMOSAUR_H
#define FPS_TIMEOUT 60
#define TIMER_RANGE 4
enum GAME_STATE_TABLE {
GAME_STARTED,
GAME_OVER,
GAME_AI
};
struct Point {
int x;
int y;
};
struct Score {
int time;
int passed;
};
class Termosaur {
public:
Termosaur();
~Termosaur();
void start();
private:
Point winSize;
Score score;
char *emptyLine;
char timer;
char debounceTimer;
char jumpTimer;
bool isJump;
int bushPos;
char gameState;
void startCurses();
void stopCurses();
void draw();
void drawDino();
void drawTerrain();
void drawBush();
void drawScore();
void clear();
void gameOver();
void aiGame();
void startGame();
void jump();
};
#endif