-
Notifications
You must be signed in to change notification settings - Fork 0
/
snackball.html
63 lines (50 loc) · 1.71 KB
/
snackball.html
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
<!DOCTYPE html>
<html>
<head>
<title>SnackBall</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0"/>
<meta name="format-detection" content="telephone=no">
<!-- CSS development files -->
<link rel="stylesheet" href="game.core.css" />
<link rel="stylesheet" href="ball.class.css" />
<link rel="stylesheet" href="map.tileset.css" />
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
<script src="/socket.io/socket.io.js"></script>
<script src="/qrcode.js/qrcode.min.js"></script>
<script src="/player.class.js"></script>
<script src="/ball.class.js"></script>
<script src="/game.core.js"></script>
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
</head>
<body>
<stage>
</stage>
</body>
<script>
var house = [
['house1-left-up-corner','house1-middle-up','house1-right-up-corner'],
['house1-left-middle-corner','house1-middle-middle-corner','house1-right-middle-corner'],
['house1-left-down-corner','house1-middle-down-corner','house1-right-down-corner'],
['house1-left-wall-corner','house1-middle-wall-corner','house1-right-wall-corner']
];
/*print map*/
var TILE_WITH = 16; //px square
var X_TILES = parseInt(window.innerWidth /TILE_WITH);
var Y_TILES = parseInt(window.innerHeight /TILE_WITH);
for(var i = 0;i< Y_TILES;i++){
hy = 0;
for(var j = 0; j< X_TILES;j++){
var h = 0;
if(j >= 5 && j<=7 && i>= 2 && i<=5){
$(document.body).append('<div class="map '+house[i-2][j-5]+'"></div>');
}else{
$(document.body).append('<div class="map grass"></div>');
}
}
}
(function(){
game.init(40);
})();
</script>
</html>