blob: b212c67b61efbdae743597d9b7a12061a68bfe25 (
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
|
#ifndef LEVEL_H
#define LEVEL_H
#include "Player.h"
#include "Screen.h"
#include "Platform.h"
#include "Hazard.h"
class Level {
public:
Level();
// Load and prepare a new level
void changeLevel(int levelNo);
// Moves all the level's items around
void move();
// Draw the current scene on the screen
void draw(Screen *screen);
// The human player
Player player;
private:
// Background image
SDL_Surface *background;
// Map platforms
int numPlatforms;
Platform platform[576];
// Hazards
int numHazards;
Hazard hazard[576];
// Reads in the map file
void loadMap(int levelNo);
int cameraX;
int checkCollision(SDL_Rect r);
int startX, startY;
};
#endif
|