This repository has been archived by the owner on Dec 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.html
127 lines (108 loc) · 4.54 KB
/
index.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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="css/reset.css" />
<link rel="stylesheet" href="css/style.css" />
<title>Advance Wars, le plus court chemin</title>
</head>
<body>
<script src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
<script src="http://localhost:1337/socket.io/socket.io.js"></script>
<script src="js/bdd.js"></script>
<script src="maps/hip.js"></script>
<script src="js/fonctions.js"></script>
<script src="js/units.class.js"></script>
<script src="js/deplacement.class.js"></script>
<script src="js/tir.class.js"></script>
<script src="js/controller.class.js"></script>
<script src="js/warfog.class.js"></script>
<script src="js/transport.class.js"></script>
<script src="js/refresh.class.js"></script>
<script>
//def constante
var myTeam = 0;
var myTeamInverse = [1,0];
var partieId = 0;
var modeSync = false;
var units = new Array();
var teams = new Array();
var bats = new Array();
var heroes = new Array();
var unitsMap = new Array();
var batsMap = new Array();
$(document).ready(function()
{
//def HTML map
genererHTMLcarte();
//def Teams :
teams[0] = new Team(0, 'blue', $.extend(true, {}, BDD.Heroes.Max));
teams[1] = new Team(1, 'red', $.extend(true, {}, BDD.Heroes.Sami));
teams[2] = new Team(2, 'gray', '');// batiments neutres
//def Bats
bats[0] = new Bat(0, teams[1], 'ville', 3, 6);
bats[1] = new Bat(1, teams[0], 'usine', 1, 7);
//def Units
units.push(new Unit( teams[1], 'recon', 2, 8, true, $.extend(true, {}, BDD.Unites.Recon)));
units.push(new Unit( teams[1], 'infantry', 4,6, true, $.extend(true, {}, BDD.Unites.Infantry)));
units.push(new Unit( teams[0], 'vtb', 3,8, true, $.extend(true, {}, BDD.Unites.Vtb)));
units.push(new Unit( teams[0], 'neotank', 4, 7, true, $.extend(true, {}, BDD.Unites.Neotank)));
units.push(new Unit( teams[0], 'infantry', 3,7, true, $.extend(true, {}, BDD.Unites.Infantry)));
});
//node
jQuery(window).load(function(){
var socket = io.connect('http://localhost:1337');
socket.on('connect', function(){
socket.emit('newUser');
});
socket.on('log', function(data){
c = new Date();
d = c.getHours()+':'+c.getMinutes()+':'+c.getSeconds()+'';
$('#debug-node').append(d + ' : ' + data + '<br />');
});
socket.on('createTeam', function(data){
if(isEven(data)){
myTeam = 0;
}
else{
myTeam = 1;
}
console.log(myTeam);
controller = new Controller(map[nom_map], teams[myTeam]);
controller.afficherCarte();
});
});
</script>
<div id="debug-node" style="width:500px;height:500px;border:1px solid silver;position:absolute;right:0;top:0;">
debug node<br />
</div>
<img id="canvasSource" src="maps/hip.gif" style="position:absolute;top:-300px;" />
<canvas id="canvasMap" width="256" height="176" style="position:absolute;">Votre navigateur ne supporte pas les Canvas.</canvas>
<table id="deplacement_layer" style="position:absolute;opacity:0.6;" border="0" cellspacing="0" cellpadding="0">
</table>
<table id="trace_layer" style="position:absolute;;" border="0" cellspacing="0" cellpadding="0">
</table>
<table id="over_layer" style="position:absolute;opacity:0;z-index:100;" border="0" cellspacing="0" cellpadding="0">
</table>
<div id="cursor" class="cursorSelect"></div>
<div id="units_container"></div>
<div id="bats_container"></div>
<div id="menuBox" class="box">
<a href="#" id="capture"><img src="images/pictos/capturer.gif" /> Capturer</a>
<a href="#" id="decharge"><img src="images/pictos/charger.gif" /> Decharger</a>
<a href="#" id="charge"><img src="images/pictos/charger.gif" /> Charger</a>
<a href="#" id="attack"><img src="images/pictos/degats.gif" /> Attaquer</a>
<a href="#" id="wait"><img src="images/pictos/attendre.gif" /> Attendre</a>
<a href="#" id="cancel">Annuler</a>
</div>
<div id="jourBox" style="font-size:12px;position:absolute; left:260px;top:100px;width:135px;padding:10px; height:15px; border:1px solid silver;">
<a href="#" id="finJour">Fin de la journée</a><br />
</div>
<div id="degatsBox" style="font-size:12px;position:absolute; left:260px;top:135px;width:135px;padding:10px; height:20px; border:1px solid silver;">
</div>
<div id="shopBox" style="font-size:12px;position:absolute; left:0px;top:180px;width:235px;padding:10px; border:1px solid silver;">
</div>
<div id="debugBox" style="font-size:12px;position:absolute; left:0px;top:200px;width:235px;padding:10px; border:1px solid silver;">
</div>
</body>
</html>