-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
36 lines (36 loc) · 1.39 KB
/
Copy pathindex.html
File metadata and controls
36 lines (36 loc) · 1.39 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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>贪吃蛇游戏</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="game-container">
<h1>贪吃蛇游戏</h1>
<div class="game-info">
<div class="score">分数: <span id="score">0</span></div>
<div class="level">等级: <span id="level">1</span></div>
</div>
<div class="game-board" id="game-board"></div>
<div class="game-controls">
<button id="start-btn">开始游戏</button>
<button id="pause-btn">暂停游戏</button>
<button id="reset-btn">重置游戏</button>
</div>
<div class="game-instructions">
<p>使用方向键控制蛇的移动,或者点击屏幕上的方向按钮</p>
<div class="direction-buttons">
<button class="dir-btn" data-direction="up">↑</button>
<div class="horizontal-buttons">
<button class="dir-btn" data-direction="left">←</button>
<button class="dir-btn" data-direction="right">→</button>
</div>
<button class="dir-btn" data-direction="down">↓</button>
</div>
</div>
</div>
<script src="script.js"></script>
</body>
</html>