-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.h
112 lines (102 loc) · 2.02 KB
/
game.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
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
#ifndef _GAME_H_
#define _GAME_H_
#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <stdio.h>
#include "NeHeGL.h"
#include "NeHe_Window.h"
#include "Bitmap.h"
#include "bass.h"
class Position
{
public:
int x, y;
};
enum EnemyType
{
Kraken,
Seastar,
Jellyfish,
Cancer,
EnemyBullet,
CancerBullet,
Lion,
Worm
};
class Enemy
{
public:
Position position;
EnemyType type;
int width, height;
bool moving;
Position whereToGo;
int variable [10];
};
class Game
{
public:
bool Initialize (GL_Window *window, Keys *keys, DWORD tickCount);
void Deinitialize ();
void Update (DWORD tickCount, DWORD lastTickCount);
void Draw (DWORD tickCount);
private:
void NewGame (DWORD tickCount);
void UpdateLives (bool generate);
void NewGame_Sub (DWORD tickCount);
void EnterDinosaur (DWORD tickCount);
enum GameStates
{
ActualGame,
GameOver,
TitlePicture,
ActualGame_Dinosaur,
GameCompleted
} gameState;
GL_Window *g_window;
Keys *g_keys;
bool spacePressed;
int spacePressedSince;
bool escapePressed;
bool keyPressedUpDown;
bool keyPressedLeftRight;
int keyPressedUpDownSince;
int keyPressedLeftRightSince;
int blinkingDuration;
Bitmap bitmap [20];
GLuint texture [20];
Position playerPosition;
Position bulletPosition [10];
bool bulletActive [10];
int lastBulletMove;
Enemy enemy [20];
int lastEnemyAppeared;
bool enemyActive [20];
int startTime;
int lives;
Bitmap bitmap_lives;
GLuint texture_lives;
Bitmap bitmap_titlescreen;
GLuint texture_titlescreen;
Bitmap bitmap_gameover;
GLuint texture_gameover;
Position platformPosition [15];
bool platformActive [15];
bool dinosaurMoving;
int jumping;
int falling;
int movingswitchedSince;
bool movingDirection;
bool gap;
int rightmost;
bool bulletDirection [10];
int completed;
Bitmap bitmap_gamecompleted;
GLuint texture_gamecompleted;
bool scrolling;
int upward;
int lastVerticalMove;
HSTREAM soundeffect [6];
};
#endif