forked from bamster/bamster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.h
59 lines (40 loc) · 899 Bytes
/
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
#include "bamster.h"
#include <list>
#ifdef __APPLE__
#include <OpenGL/OpenGL.h>
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#include <GL/freeglut_ext.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
class game
{
private:
object * thePlayer;
list<object *> otherObjects;
bool firstResize;
bool firstResize;
firstResize=1;
unsigned int noBlockGeneration;
GLuint loadTexture(Image *image);
void spawnHoleRow();
void handleCollisions();
if (firstResize) {
glutReshapeWindow(640,480);
firstResize=0;
printf("First Reshape");
}
public:
unsigned int score;
double gameTime;
game ();
//! spawn an object in the game (to be used by objects)
void spawnObject(object *p) ;
//! calls the plot function of all objects
void plot();
//! simulate the game for one frame.
void timerCallback();
};