-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
111 lines (106 loc) · 4.57 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>PC Grafika ThreeJS </title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" href="css/main.css">
</head>
<script src="js/threejs/build/three.js"></script>
<script src="js/threejs/js/controls/OrbitControls.js"></script>
<script src="js/threejs/THEEx.KeyboardState.js"></script>
<script src="js/threejs/js/loaders/MTLLoader.js"></script>
<script src="js/threejs/js/loaders/OBJLoader.js"></script>
<script src="js/threejs/js/loaders/GLTFLoader.js"></script>
<script src="js/threejs/js/loaders/FBXLoader.js"></script>
<script type="module" src="js/threejs/js/animation/AnimationMixer.js"></script>
<script src="js/threejs/js/libs/inflate.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<body>
<script src="js/main.js" type="module"></script>
<div class="t" id="hp&collected">
<div class="stats-inner align-items-center">
<p class="text-white" id="collected">Collected 0/3</p>
<p class="text-white" id="life">Lives 3</p>
</div>
</div>
<div class="game-over-layout d-flex flex-column justify-content-center" id="game-over">
<div class="game-over-text">GAME OVER</div>
<button type="button" class="btn btn-outline-secondary" id='try-again'>Try again</button>
</div>
<div class="game-over-layout d-flex flex-column justify-content-center" id="game-won">
<div class="game-over-text">Congrats! U won!</div>
<div class="game-over-text mb-2" id='score'></div>
<button type="button" class="btn btn-outline-secondary" id='play-again'>Play again</button>
</div>
<div class="container" id="container">
<div class="ui">
<div class="game-menu-layout align-items-center" id="game-menu">
<div class="game-menu-window border rounded border-secondary p-5">
<div class="align-items-center">
<h1 class="mb-5">3D Drone Game</h1>
<h5>Goals of the game:</h5>
<ol>
<li>Collect all required items</li>
<li>Reach the final destination</li>
</ol>
<h5>How to control the drone:</h5>
</div>
<div class="row">
<div class="col-6">
<div class="d-flex flex-row justify-content-between align-items-center p-1">
<img class="" src="./assets/wkey.png"></img>
<p class="text-muted mt-1">Move forward</p>
</div>
<div class="d-flex flex-row justify-content-between align-items-center p-1">
<img src="./assets/akey.png"></img>
<p class="text-muted mt-1">Move left</p>
</div>
<div class="d-flex flex-row justify-content-between align-items-center p-1">
<img src="./assets/dkey.png"></img>
<p class="text-muted mt-1">Move right</p>
</div>
<div class="d-flex flex-row justify-content-between align-items-center p-1">
<img src="./assets/skey.png"></img>
<p class="text-muted mt-1">Move backward</p>
</div>
</div>
<div class="col-6">
<div class="d-flex flex-row justify-content-between align-items-center p-1">
<img class="" src="./assets/upkey.png"></img>
<p class="text-muted mt-1">Move up</p>
</div>
<div class="d-flex flex-row justify-content-between align-items-center p-1">
<img src="./assets/leftkey.png"></img>
<p class="text-muted mt-1">Turn left</p>
</div>
<div class="d-flex flex-row justify-content-between align-items-center p-1">
<img src="./assets/rightkey.png"></img>
<p class="text-muted mt-1">Turn right</p>
</div>
<div class="d-flex flex-row justify-content-between align-items-center p-1">
<img src="./assets/downkey.png"></img>
<p class="text-muted mt-1">Move down</p>
</div>
</div>
</div>
<div class="d-flex justify-content-center">
<button type="button" class="btn btn-secondary mt-3 m-1 w-100" id="playBtn">Play</button>
</div>
<h5 id="score" class="d-flex flex-row justify-content-center align-items-center mt-2"></h5>
</div>
</div>
</div>
</div>
</body>
<script>
var highest_score;
function get_highest_score(){
if(localStorage.getItem('drone-game-score')){
highest_score = localStorage.getItem('drone-game-score')
document.getElementById("score").innerHTML = "Your highest score is " + highest_score;
}
}
get_highest_score()
</script>
</html>