summaryrefslogtreecommitdiff
path: root/noncore/games/sfcave-sdl/terrain.h
Unidiff
Diffstat (limited to 'noncore/games/sfcave-sdl/terrain.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/sfcave-sdl/terrain.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/noncore/games/sfcave-sdl/terrain.h b/noncore/games/sfcave-sdl/terrain.h
new file mode 100644
index 0000000..4070318
--- a/dev/null
+++ b/noncore/games/sfcave-sdl/terrain.h
@@ -0,0 +1,50 @@
1#ifndef __TERRAIN_H
2#define __TERRAIN_H
3
4#include <SDL.h>
5
6class StarField;
7class Terrain
8{
9public:
10 Terrain( int w, int h, bool drawTop = true, bool drawBottom = true );
11 virtual ~Terrain();
12
13 virtual void initTerrain();
14 virtual void moveTerrain( int amountToMove );
15 virtual bool checkCollision( int x, int y, int h );
16 virtual void drawTerrain( SDL_Surface *screen );
17
18 int getMapTop( int pos ) { return mapTop[pos]; }
19 int getMapBottom( int pos ) { return mapBottom[pos]; }
20 int getMaxHeight() { return maxHeight; }
21 void increaseMaxHeight( int amount );
22
23 int offset;
24protected:
25
26 int sWidth;
27 int sHeight;
28
29 int drawTop;
30 int drawBottom;
31
32 int mapTop[MAPSIZE];
33 int mapBottom[MAPSIZE];
34 int maxTop;
35 int maxBottom;
36
37 int maxHeight;
38 int dir;
39 int speed;
40 int segSize;
41
42 SDL_Surface *terrainSurface;
43 StarField *stars;
44
45 void setPoint( int point );
46};
47
48
49#endif
50