-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
79 lines (62 loc) · 2.19 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="js/Animation.js" type="text/javascript"></script>
<script src="js/Objects.js" type="text/javascript"></script>
<script src="js/Draw.js" type="text/javascript"></script>
<script src="js/Statistics.js" type="text/javascript"></script>
<title>JS Football Simulator</title>
</head>
<body>
<canvas id="canvas"></canvas>
<div class="table">
<ul class="statistics">
<li><h1 class="score" id="timer"></h1></li>
<li><h1 class="score">Score: </h1><h1 class="score" id="scoreB">0</h1><h1 class="score"> - </h1><h1 class="score" id="scoreA">0</h1></li>
<li><h3 class="stat" id="outs"></h3></li>
<div>
</ul>
<script>
var my_canvas = document.getElementById("canvas");
my_canvas.width = Pitch.width+50;
my_canvas.height = Pitch.height+50;
document.body.appendChild(my_canvas);
var ctx = my_canvas.getContext('2d');
var x = Pitch.out+Pitch.width/2;
var y = Pitch.height/2;
var h = 40;
var fps = AnimationSettings.fps;
var startTime = Date.now();
var distance;
//player 1
var pl01x = Pitch.out+Pitch.width/4;
var pl01y = Pitch.height/2;
var dirPl01x = 1;
var dirPl01y = 1;
var pl01ball = false;
//player 2
var pl02x = Pitch.out+3*Pitch.width/4;
var pl02y = Pitch.height/2;
var dirPl02x = 1;
var dirPl02y = 1;
var pl02ball = false;
//player 3, controllable
var pl03x = Pitch.out+Pitch.width/4*3;
var pl03y = Pitch.height/2;
var dirPl03x = 0;
var dirPl03y = 0;
var pl03ball = false;
var dirX = Ball.speed*Ball.startDirX;
var dirY = Ball.speed*Ball.startDirY;
var lastTime = 0;
var goalA = 0; document.getElementById("scoreA").innerHTML = goalA;
var goalB = 0; document.getElementById("scoreB").innerHTML = goalB;
var outs = 0; document.getElementById("outs").innerHTML = "Outs: " + outs;
animationLoop();
</script>
</body>
</html>