-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.cpp
More file actions
52 lines (50 loc) · 983 Bytes
/
map.cpp
File metadata and controls
52 lines (50 loc) · 983 Bytes
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
#include"map.h"
#include<time.h>
HBITMAP map_ = (HBITMAP)LoadImage(NULL, L"bp.bmp", IMAGE_BITMAP, 600, 600, LR_LOADFROMFILE);
HBITMAP WALL = (HBITMAP)LoadImage(NULL, L"wall.bmp", IMAGE_BITMAP, 30, 30, LR_LOADFROMFILE);
void map::drawmap(HDC hdc,int i,int j)
{
HDC mdc = CreateCompatibleDC(hdc);
if (!mapdata[i][j])
{
SelectObject(mdc, WALL);
BitBlt(hdc, j * 30, i * 30, 30, 30, mdc, 0, 0, SRCCOPY);
}
DeleteObject(mdc);
}
void map::switchmap()
{
if (stage == 1)
{
stage = 2;
for (int i = 0; i < MAPLONG; ++i)
{
for (int j = 0; j < MAPLONG; ++j)
{
mapdata[i][j] = mapdata2[i][j];
}
}
}//第一张地图切换到第二张
else if (stage == 2)
{
stage = 3;
for (int i = 0; i < MAPLONG; ++i)
{
for (int j = 0; j < MAPLONG; ++j)
{
mapdata[i][j] = mapdata3[i][j];
}
}
}//第二张到第三张
else
{
stage = 0;
}
}
bool map::map_finish()
{
if (stage == 0)
return 1;
else
return 0;
}