We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b91927 commit a754699Copy full SHA for a754699
1 file changed
game/tcs.html
@@ -26,7 +26,7 @@
26
</head>
27
<body>
28
<div id="score">得分: 0</div>
29
- <canvas id="gameCanvas" width="400" height="400"></canvas>
+ <canvas id="gameCanvas" width="500" height="500"></canvas>
30
<script>
31
// 初始化变量:ml-citation{ref="2,5" data="citationList"}
32
const canvas = document.getElementById('gameCanvas');
@@ -82,7 +82,7 @@
82
function checkCollision() {
83
const head = snake[0];
84
// 边界碰撞
85
- if (head.x < 0 || head.x >= 400 || head.y < 0 || head.y >= 400) return true;
+ if (head.x < 0 || head.x >= 500 || head.y < 0 || head.y >= 500) return true;
86
// 自身碰撞
87
for (let i = 1; i < snake.length; i++) {
88
if (head.x === snake[i].x && head.y === snake[i].y) return true;
0 commit comments