-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathending.html
134 lines (128 loc) · 4.73 KB
/
ending.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
127
128
129
130
131
132
133
134
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>War</title>
</head>
<body>
<div class="container">
<div class="header">
</div>
<div class="main">
<div class="text-area" style="color: wheat;">
<p id="moneyspangame"></p>
<p id="playerhp"></p>
<p id="magazine"></p>
<p id="message"></p>
<p id="msglevel"></p>
<p id="msgtargetkills"></p>
</div>
<video autoplay controls>
<source src="../assets/vid/ending.mp4" type="video/mp4" width="800" height="400">
Your browser does not support the video tag.
</video>
<!-- <div class="analog">
<div class="move-analog">
<button>X</button>
<button>U</button>
<button>X</button>
<button>L</button>
<button>X</button>
<button>R</button>
<button>X</button>
<button>D</button>
<button>X</button>
</div>
<div class="weapon-analog">
<button>X</button>
<button>U</button>
<button>X</button>
<button>L</button>
<button>X</button>
<button>R</button>
<button>X</button>
<button>D</button>
<button>X</button>
</div>
</div> -->
<div class="input-area">
<a href="index.html">
<button id="startbtn">BACK To Home</button>
</a>
<button id="restartbtn">x</button>
</div>
</div>
</div>
</div>
<div class="blocker">
<h6>Mohon Maaf game ini hanya bisa <p></p>di mainkan di pc / laptop saja</h6>
</div>
<script>
const resources = [
{ type: 'img', url: 'bgloby.png' },
{ type: 'img', url: 'bg1.png' },
{ type: 'img', url: 'bg2.png' },
{ type: 'img', url: 'bg3.png' },
{ type: 'img', url: 'bg4.png' },
{ type: 'img', url: 'overbg1.png' },
{ type: 'img', url: 'overbg2.png' },
{ type: 'img', url: 'overbg3.png' },
{ type: 'img', url: 'overbg4.png' },
{ type: 'img', url: 'player.png' },
{ type: 'img', url: 'enemy.png' },
{ type: 'bgm', url: 'amparpisang.mp3' },
{ type: 'bgm', url: 'apuse.mp3' },
{ type: 'bgm', url: 'flobamora.mp3' },
{ type: 'bgm', url: 'ibupertiwi.mp3' },
{ type: 'bgm', url: 'indonesiapusaka.mp3' },
{ type: 'bgm', url: 'kerosene.mp3' },
{ type: 'bgm', url: 'kincir.mp3' },
{ type: 'bgm', url: 'lathi.mp3' },
{ type: 'bgm', url: 'yamko.mp3' },
{ type: 'sfx', url: 'coinpick.wav' },
{ type: 'sfx', url: 'enemydeath.wav' },
{ type: 'sfx', url: 'fail.mp3' },
{ type: 'sfx', url: 'fire (2).mp3' },
{ type: 'sfx', url: 'fire.mp3' },
{ type: 'sfx', url: 'hit.wav' },
{ type: 'sfx', url: 'win.mp3' },
{ type: 'vid', url: 'ending.mp4' },
];
function allResourcesLoaded() {
const allElements = resources.map(url => {
if (url.endsWith('.png')) {
const img = new Image();
img.src = url;
return img;
} else if (url.endsWith('.mp3') || url.endsWith('.wav')) {
const audio = new Audio();
audio.src = url;
return audio;
}else if (resource.url.endsWith('.mp4') || resource.url.endsWith('.webm') || resource.url.endsWith('.ogg')) {
const video = document.createElement('video');
video.src = resource.url;
return video;
}
return null;
});
return allElements.every(element => element.complete);
}
window.onload = function () {
if (!allResourcesLoaded()) {
window.location.href = 'loading.html';
} else {
}
};
</script>
<script>
function playVideo() {
const video = document.querySelector('video');
video.play();
}
</script>
<script src="ending.js"></script>
</body>
</html>