forked from Allentome/fly_boy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
38 lines (32 loc) · 1.05 KB
/
index.html
File metadata and controls
38 lines (32 loc) · 1.05 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title> 菜先生超帅 </title>
<script type="text/javascript" src="phaser.min.js"></script>
<script type="text/javascript" src="main.js"></script>
<script>
var bgmusic = document.getElementById('bgmusic');
bgmusic.addEventListener('canplay', function () {
this.play();
}, false);
window.addEventListener('load', function () {
window.addEventListener('touchstart', once, false);
}, false);
function once() {
bgmusic.play();
window.removeEventListener('touchstart', once, false);
}
</script>
<style>
canvas{
width: 100%;
}
</style>
</head>
<body>
<h1>按空格键或者点击屏幕使菜先生移动</h1>
<!-- <audio src="becasue you.m4a" controls="" class="music" id="audio" style="width: 40%;margin-left: 30%"></audio> -->
<audio src="./becasue you.m4a" preload="meta" loop autoplay id="bgmusic"></audio>
</body>
</html>