-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameObject.h
More file actions
124 lines (98 loc) · 2.2 KB
/
Copy pathGameObject.h
File metadata and controls
124 lines (98 loc) · 2.2 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#ifndef GAMEOBJECT_H_
#define GAMEOBJECT_H_
#define CLOUD_NUM 10
enum{
STATE_NORMAL,
STATE_HUNGRY,
STATE_STARVE,
STATE_SLEEPY,
STATE_SLEEP,
STATE_STROKE,
STATE_STROKE_HAPPY,
};
class GameObject{
public:
bool show;
int16_t x;
int16_t y;
uint8_t sizex;
uint8_t sizey;
virtual void move();
virtual void draw();
};
class BackGround : public GameObject{
private:
class Cloud{
public:
uint8_t imageNum;
int16_t x;
int16_t y;
bool show;
uint8_t downSpeed;
Cloud();
void move();
void draw();
};
public:
BackGround();
Cloud clouds[CLOUD_NUM];
void drawOutSide();
void move();
void draw();
};
class Character : public GameObject{
private:
uint8_t* animation;
void moveAnimation();
public:
int8_t life;//体力 0になると倒れる(不可逆)
int8_t stomach;//満腹度
int8_t sleepiness;//眠気(低いと眠い)
int8_t happiness;//楽しさ
int8_t favorability;//一時好感度
//happiness = 100*favorability/(time+favorability)
int8_t love;//真の好感度
uint8_t loopTime;//パラメータ変動時間0になったら変動
Character();
void statusChanger();
void move();
void draw();
uint8_t state;
void changeState(uint8_t state);
uint8_t behavior;
uint8_t animationNum;
uint8_t eyeState;//現在の目の状態
uint8_t bodyState;//現在の体の状態
bool flip;//表示を反転させるフラグ
void drawEye();
};
class UI : public GameObject{
private:
bool menuOpen;
int8_t UIcursor;
int8_t secondCursor;
void moveTouch();
void moveEat();
void moveInfo();
void moveSave();
void movePowor();
void moveSetting();
void drawMenubar();
void drawTouch();
void drawEat();
void drawInfo();
void drawSave();
void drawPowor();
void drawSetting();
//void (UI::*moves[6])(void);
public:
UI();
void move();
void draw();
void drawClock(int16_t x,int16_t y);
};
GameObject* gameobjects[4];
BackGround background;
Character character;
UI userinterface;
#endif