-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTileGrid.java
More file actions
103 lines (94 loc) · 3.91 KB
/
Copy pathTileGrid.java
File metadata and controls
103 lines (94 loc) · 3.91 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/**
* A grid created by an array of Tiles that represents the board space
*
* @Team MAGA
* @Author Gajun Young - 16440714
* @Author Royal Thomas - 16326926
* @Author Richard Otroshchenko - 16353416
*/
public class TileGrid {
public Tile[][] map; //Array of Tiles
//{WALL, PATH, ROOM, ENTERANCE, SECRET, SIT};
private int[][] property = new int[][]
{ {0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0},
{2,2,2,2,2,4,0,1,1,1,2,2,2,2,1,1,1,0,2,2,6,2,6,2},
{2,6,2,6,2,2,1,1,2,2,6,6,6,2,2,2,1,1,2,6,5,5,5,2},
{2,5,5,5,6,2,1,1,2,2,6,6,6,2,2,2,1,1,2,6,5,5,5,2},
{2,5,5,5,6,2,1,1,2,2,5,5,5,2,2,2,1,7,3,2,6,2,6,2},
{2,6,2,6,2,2,1,1,3,2,5,5,5,2,2,3,1,1,1,2,2,2,4,0},
{0,2,2,2,3,2,1,1,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,2,3,2,2,2,2,3,2,1,1,1,1,1,1,1,0},
{0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2},
{2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,3,2,6,6,5,5},
{2,2,2,2,2,2,2,2,1,1,0,0,0,0,0,1,1,1,2,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//Array size
private static final int COLUMN = 24;
private static final int ROW = 25;
//Grid offset
private float x = 42.5f;
private float y;
//Constructor that builds the array of tiles
public TileGrid() {
map = new Tile[ROW][COLUMN]; //Dimension of the Board
for (int i = 0; i < map.length; i++) {
y += 23;
x = 42.5f;
for (int j = 0; j < map[i].length; j++) {
map[i][j] = new Tile(x, y, i, j, property[i][j], room[i][j]);
x += 23;
}
}
}
/*
//Draw the grid tiles onto the map
public void drawGrid(Graphics g) {
for (int i = 0; i < map.length; i++) {
for (int j = 0; j < map[i].length; j++) {
map[i][j].drawTile(g);
}
}
}*/
}