-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainobject.h
68 lines (64 loc) · 1.56 KB
/
mainobject.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
#ifndef mainobject_H
#define mainobject_H
#include <bits/stdc++.h>
#include <windows.h>
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_mixer.h>
using namespace std;
struct PLV{
int l1;
int r1;
int l2;
int r2;
};
extern PLV pos_lv[10];
class Map_ {
public:
SDL_Texture *lv[10];
SDL_Texture* loadTexture(const std::string &file);
SDL_Texture *welcome;
SDL_Texture *start;
SDL_Texture *level;
SDL_Texture *quit;
SDL_Texture *bgl;
void Lv();
void renderTexture(SDL_Texture *texture, int x, int y, int w, int h);
void renderTexture(SDL_Texture *texture, int x, int y);
void load_map();
void set_plv() {
int x = 50, y = 50;
for (int i = 1; i <= 9; i++) {
pos_lv[i].l1 = x;
pos_lv[i].r1 = x + 300;
pos_lv[i].l2 = y;
pos_lv[i].r2 = y + 100;
x += 400;
if (x > 1200) {
x = 50;
y += 200;
}
}
}
void load_data(int level);
void load_img();
void RandMap();
void wel_load();
void load_level();
void load_continue();
};
extern const int TILE_SIZE;
extern const int MAX_MAP_X;
extern const int MAX_MAP_Y;
extern const int SCREEN_WIDTH;
extern const int SCREEN_HEIGHT;
extern int x_pos_, y_pos_;
extern SDL_Texture *img[20];
extern SDL_Window* window;
extern SDL_Renderer* renderer;
extern bool ok[50];
extern int mat[30][30];
extern SDL_Texture *bg;
extern SDL_Texture *dango;
extern Map_ Map;
#endif