-
Notifications
You must be signed in to change notification settings - Fork 0
/
icelevel.cpp
87 lines (66 loc) · 1.82 KB
/
icelevel.cpp
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include "icelevel.h"
icelevel::icelevel(int screenW,int screenH,int *tileSize, int *scale)
{
m_screenW=screenW;
m_screenH=screenH;
p_tileSize=tileSize;
p_scale=scale;
_tile tmp;
for (int x=0; x< (m_screenW / *tileSize) ; x++)
{
tmp.x=x;
tmp.y=0;
tmp.size=*tileSize;
tmp.n=2;
mapLevel.push_back(tmp);
tmp.x=x;
tmp.y=1;
tmp.size=*tileSize;
tmp.n=1;
mapLevel.push_back(tmp);
tmp.x=x;
tmp.y= (m_screenH / *tileSize)-1;
tmp.size=*tileSize;
tmp.n=2;
mapLevel.push_back(tmp);
tmp.x=x;
tmp.y= (m_screenH / *tileSize);
tmp.size=*tileSize;
tmp.n=1;
mapLevel.push_back(tmp);
}
//Lava
for (int x=((m_screenW / *tileSize)/2)-2; x < ((m_screenW / *tileSize)/2)+2 ; x++)
{
tmp.x=x;
tmp.y=(m_screenH / *tileSize)/2;
tmp.size=*tileSize;
tmp.n=3;
mapLevel.push_back(tmp);
}
for (int y=0; y < (m_screenH / *tileSize)-1 ; y++)
{
tmp.x=0;
tmp.y=y;
tmp.size=*tileSize;
tmp.n=2;
mapLevel.push_back(tmp);
tmp.x= (m_screenW / *tileSize)-1;
tmp.y=y;
tmp.size=*tileSize;
tmp.n=2;
mapLevel.push_back(tmp);
}
}
int icelevel::getX(int n){return mapLevel[n].x;}
int icelevel::getY(int n){return mapLevel[n].y;}
bool icelevel::getPassable(int n){return mapLevel[n].passable;}
bool icelevel::getDangerous(int n){return mapLevel[n].dangerous;}
int icelevel::getTile(int n)
{
return mapLevel[n].n;
}
int icelevel::getSize()
{
return mapLevel.size();
}