-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMap.h
70 lines (52 loc) · 1.2 KB
/
Map.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
69
70
#ifndef __MAPH__
#define __MAPH__
#include <SDL/SDL.h>
#include <SDL/SDL_ttf.h>
#include "Role.h"
#ifdef PSP
#define SCR_W 480
#define SCR_H 270
#else
#define SCR_W 480
#define SCR_H 320
#endif
//BOOL flash;
//地图类声明
class Map
{
public:
int ID;
char Name[32];
short Tile[10][15];
short Trap[10][15];
short Block[10][15];
int count_in_row;
SDL_Surface * Surf;
int NpcNum;
int Npcs[15];
Role *Npc;
TTF_Font *Font;
SDL_Color *Color;
public:
Map();
~Map();
void init_map(int id, const char name[],short tile[10][15],
short trap[][15], short block[][15],
SDL_Surface *surf, int n,
TTF_Font *font, SDL_Color *color);
void draw_map(SDL_Surface *dest_surf, Role& player,
SDL_Surface *assist_surf);
void draw_map_only(SDL_Surface *dest_surf);
void add_npc(Role *, int x, int y);
void add_npc_id(int id);
void del_npc_id(int id);
void del_npc(Role *);
void del_all_npc();
void del_trap(int x, int y);
void add_trap(int grid_x, int grid_y, int trap_num);
void del_trap_by_num(short num);
short if_block(int xCurrent,int yCurrent);
short check_trap(int xCurrent,int yCurrent);
short npc_in_map(Role *);
};
#endif