Skip to content

Commit

Permalink
贪吃蛇
Browse files Browse the repository at this point in the history
  • Loading branch information
H0308 committed Nov 18, 2024
1 parent 4f5e447 commit 3d54f8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ setTimeout(function move() {

//判断是否撞墙
if (x < 0 || x > 290 || y < 0 || y > 290) {
alert("撞墙了!游戏结束!");
alert("Collision with the wall! Game Over!");
// 游戏结束
return;
}
Expand All @@ -141,7 +141,7 @@ setTimeout(function move() {
snakes[i].offsetLeft === x &&
snakes[i].offsetTop === y
) {
alert("撞到自己了,游戏结束!");
alert("You have eaten yourself! Game Over!");
return;
}
}
Expand Down

0 comments on commit 3d54f8e

Please sign in to comment.