blob: 4070318a96d0afaf34a30a5b895384c128435b7b (
plain)
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
|
#ifndef __TERRAIN_H
#define __TERRAIN_H
#include <SDL.h>
class StarField;
class Terrain
{
public:
Terrain( int w, int h, bool drawTop = true, bool drawBottom = true );
virtual ~Terrain();
virtual void initTerrain();
virtual void moveTerrain( int amountToMove );
virtual bool checkCollision( int x, int y, int h );
virtual void drawTerrain( SDL_Surface *screen );
int getMapTop( int pos ) { return mapTop[pos]; }
int getMapBottom( int pos ) { return mapBottom[pos]; }
int getMaxHeight() { return maxHeight; }
void increaseMaxHeight( int amount );
int offset;
protected:
int sWidth;
int sHeight;
int drawTop;
int drawBottom;
int mapTop[MAPSIZE];
int mapBottom[MAPSIZE];
int maxTop;
int maxBottom;
int maxHeight;
int dir;
int speed;
int segSize;
SDL_Surface *terrainSurface;
StarField *stars;
void setPoint( int point );
};
#endif
|