-
Notifications
You must be signed in to change notification settings - Fork 2
/
map.js
65 lines (64 loc) · 2.34 KB
/
map.js
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
var Level1 = {
width: 12, // number of tiles wide
height: 11, // number of tiles tall
tileWidth: 32, // width in px of an individual tile
tileHeight: 32, // height in px of an individual tile
tiles: [
[4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3],
[1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3],
[1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3],
[1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3],
[1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3],
[1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3],
[1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3],
[1, 2, 2, 2, 3, 2, 2, 2, 3, 3, 3, 3],
[1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]
],
tileDefinition: {
1: "http://www.mikedoesweb.com/sandbox/game/images/rocks.png",
2: "http://www.mikedoesweb.com/sandbox/game/images/grass.png",
3: "http://www.mikedoesweb.com/sandbox/game/images/water.png",
4: "http://www.mikedoesweb.com/sandbox/game/images/rocks-top.png"
//Test preloading with large image,
//4: "http://cdn.thedesignwork.com/wp-content/uploads/2010/08/Night-Moscow51.jpg"
},
collidable: {
1: "rock",
3: "water",
4: "rock"
}
};
var Level2 = {
width: 12, // number of tiles wide
height: 11, // number of tiles tall
tileWidth: 32, // width in px of an individual tile
tileHeight: 32, // height in px of an individual tile
tiles: [
[3, 3, 3, 3, 3, 4, 4, 4, 4, 2, 3, 3],
[3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3],
[3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 3, 3],
[3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3],
[1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3],
[1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3],
[1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3],
[1, 2, 2, 2, 3, 2, 2, 2, 3, 3, 3, 3],
[1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]
],
tileDefinition: {
1: "http://www.mikedoesweb.com/sandbox/game/images/rocks.png",
2: "http://www.mikedoesweb.com/sandbox/game/images/grass.png",
3: "http://www.mikedoesweb.com/sandbox/game/images/water.png",
4: "http://www.mikedoesweb.com/sandbox/game/images/rocks-top.png"
//Test preloading with large image,
//4: "http://cdn.thedesignwork.com/wp-content/uploads/2010/08/Night-Moscow51.jpg"
},
collidable: {
1: "rock",
3: "water",
4: "rock"
}
};