-
Notifications
You must be signed in to change notification settings - Fork 0
/
hopscotch.hpp
123 lines (76 loc) · 2.28 KB
/
hopscotch.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
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
#ifndef HOPSCOTCH_H
#define HOPSCOTCH_H
#include "objects.hpp"
enum GameMode { menu, playing };
class SFGameWindow;
class FuseManager;
class State {
public:
void onCreate ();
void loadMap (string fname);
void loadTextures ();
void debugTxtSetup ();
void resetForNewLevel ();
void startLevel (int num);
void newOxyds (int pairs);
void menuClick (int x, int y);
void onMouseDown (int x, int y);
void onMouseUp (int x, int y) { } // May use eventually
void onKeyPress (Keyboard::Key);
void onKeyRelease (Keyboard::Key);
void hitOxyd (Oxyd& ox);
bool checkForMatch (Oxyd& ox);
void win () { deh.win(); }
void die ();
void update (const Time& time);
void draw ();
void menuDraw ();
void menuUpdate () { } // May add animations
RenderWindow* w;
SFGameWindow* gw;
FuseManager* fuseMgr;
int mx = 0,
my = 0,
mxOld = 0,
myOld = 0;
vector<Texture> matchTexs;
vector<Texture*> matchTexPtrs;
vector<Texture> gameWorldTexs;
static vector<string> matchTexList;
static vector<string> gameWorldTexList;
vector<Oxyd> oxyds;
vector<ZSprite> platforms;
vector<Stump> stumps;
vector<ZSprite*> mapItems;
Deh deh;
Oxyd* lastOxyd { nullptr };
Level* curLevel { nullptr };
static constexpr int numLevels = 3;
Level levels[numLevels];
int matchCt = 0;
int oxydPairs = 3;
Sprite bkgd,
bkgdFrame;
RectangleShape bkgdAlpha;
Text instrTxt;
static const string instrText;
SoundBuffer buffers[5];
Sound sounds[5];
//////////// MENU SCREEN /////////////////////
static constexpr int numButtons = 4;
GameMode mode = menu;
RectangleShape rects[numButtons];
Text gameTitle,
labels[numButtons];
Font titleFont,
labelFont;
vecF buttonSize { 500, 55 };
uint buttonPadding { 15 };
vecF buttonPos { ScrCX - buttonSize.x / 2 - buttonPadding / 2,
ScrCY - 180 };
//////////// DEBUG /////////////////////
Font font;
Text mouseTxt,
debugTxt;
}; //end class State
#endif