-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
84 lines (68 loc) · 1.45 KB
/
main.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#define SHIFTUP(i) ((i) << 8)
#define SHIFTDOWN(i) ((i) >> 8)
#define NUMPLATFORMS 9
#define NUMSTARS 5
#define SCORENUM 3
#define HEIGHTNUMSLOW 8
#define HEIGHTNUMFAST 7
//buttons
unsigned int buttons;
unsigned int oldButtons;
//states
int state;
enum {SPLASH, INSTRUCTIONS, GAME, PAUSE, WINLOSE};
//OAM
enum {SCORESPRITE, HEIGHTSPRITE, CHEATSPRITE, SOUNDSPRITE, PLAYERSPRITE, PLATFORMSPRITE,
STARSPRITE = PLATFORMSPRITE + (NUMPLATFORMS + 1), NUMSPRITE = STARSPRITE + (NUMSTARS + 1),
NUMHEIGHT = NUMSPRITE + (SCORENUM + 1), PRESSA = 60};
enum {PLAYERNORMAL = 0, PLAYERHALFJUMP = 4, PLAYERJUMP = 8};
enum {STATIONARY, MOVING = 2, NONE = 4, BROKEN = 6};
enum {FRONT, SIDE, SIDESIDE, CENTER};
typedef struct {
int row;
int col;
int width;
int height;
int cDel;
int type;
int active;
}PLATFORM;
//structs
typedef struct {
int row;
int oldRow;
int col;
int size;
int rDel;
int cDel;
int aniCounter;
int aniState;
int prevAniState;
int racc;
int maxVSpeed;
int stopRange;
int alive;
} PLAYER;
typedef struct {
int row;
int col;
int size;
int active;
int aniState;
}STAR;
//state methods
void goToSplash();
void updateSplash();
void goToInstructions();
void updateInstructions();
void goToGame();
void updateGame();
void goToPause();
void updatePause();
void goToWinLose();
void updateWinLose();
void handlePlatforms();
void updateOAM();
void hideSprites();
int random(int min, int max); //int platforms
int getDigit(int num, int digit);