-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
83 lines (72 loc) · 1.96 KB
/
Copy pathindex.html
File metadata and controls
83 lines (72 loc) · 1.96 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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>吃豆人</title>
<link rel="icon" href="https://www.webretrogames.com/assets/img/pacman-logo-wide.png">
<style>
body {
font-family: Arial, sans-serif;
background-color: #f7f7f7;
}
.mod-game {
width: 960px;
margin: 0 auto;
border: 1px solid #ccc;
padding: 20px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
.mod-game h1 {
color: #333;
text-align: center;
}
.mod-game p {
color: #666;
text-align: center;
}
canvas {
display: block;
background: #000;
margin: 20px auto;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
.info {
text-align: center;
margin-bottom: 20px;
}
.info p {
color: #999;
}
.controls {
text-align: center;
}
.controls button {
padding: 10px 20px;
margin: 0 10px;
cursor: pointer;
}
</style>
</head>
<body>
<div class="mod-game">
<h1>Pacman</h1>
<p>使用方向键来移动吃豆人,避开幽灵,吃掉所有的豆子!</p>
<!-- 主体画布用以呈现游戏! -->
<canvas id="game-canvas" width="960" height="640">
不支持画布!
</canvas>
<div class="info">
<p>按空格键暂停或继续!</p>
</div>
<div class="controls">
<button id="start-button">开始游戏</button>
<button id="pause-button">暂停游戏</button>
<button id="reset-button">重新开始</button>
</div>
</div>
<!-- js文件用以控制交互 -->
<script src="game.js"></script>
<script src="index.js"></script>
</body>
</html>