惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
博客园 - 聂微东
Application and Cybersecurity Blog
Application and Cybersecurity Blog
MyScale Blog
MyScale Blog
罗磊的独立博客
H
Help Net Security
L
LangChain Blog
T
Threat Research - Cisco Blogs
量子位
S
Securelist
Last Week in AI
Last Week in AI
L
Lohrmann on Cybersecurity
T
The Exploit Database - CXSecurity.com
P
Privacy International News Feed
The Hacker News
The Hacker News
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Blog of Author Tim Ferriss
T
Threatpost
Security Latest
Security Latest
P
Palo Alto Networks Blog
Microsoft Security Blog
Microsoft Security Blog
NISL@THU
NISL@THU
F
Full Disclosure
WordPress大学
WordPress大学
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Heimdal Security Blog
J
Java Code Geeks
Recorded Future
Recorded Future
Hugging Face - Blog
Hugging Face - Blog
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
B
Blog RSS Feed
月光博客
月光博客
C
Cisco Blogs
V
Visual Studio Blog
D
DataBreaches.Net
H
Hacker News: Front Page
博客园 - 叶小钗
N
News and Events Feed by Topic
爱范儿
爱范儿
A
Arctic Wolf

Zyyo

Pi Agent Core:极简 AI Coding Agent 核心解析 锐捷校园网认证工具 - Zyyo 一个综合树维教务系统的选课排课客户端基于nodejs - Zyyo 使用javscript手写json-parse - Zyyo Archlinux保姆级安装教程 - Zyyo Zyang一款从0打造的优雅Typecho主题 - Zyyo 全新开源个人主页-ZYYO主页 - Zyyo 第一辆自行车-喜德盛ad300拿下 - Zyyo 临近期末的近况 - Zyyo 新跑表-华为GT Runner - Zyyo
闲来无事-Vue3实现贪吃蛇小游戏 - Zyyo
Zyyo · 2025-02-02 · via Zyyo

⚠️本文发布于 497 天前,内容可能已过时,请注意甄别信息的准确性。

屏幕截图 2025-02-02 002015.png

贪吃蛇游戏

先睡觉,演示站还没搭建
开源地址:https://github.com/ZYYO666/my-vue3-snake-demo
这是一个基于 Vue.js 的简单贪吃蛇游戏。玩家可以通过方向键控制蛇的移动,吃掉食物来增加分数。游戏提供了多种配置选项,包括网格大小、游戏难度、是否开启边框以及是否允许穿墙等功能。

功能特性

  • 网格大小调整:可以通过滑块调整游戏网格的大小,范围从 15x15 到 100x100。
  • 游戏难度调整:可以通过滑块调整游戏难度,难度越高,蛇的移动速度越快。
  • 边框控制:可以选择是否开启网格边框。
  • 穿墙模式:可以选择是否允许蛇穿墙,开启后蛇可以从一侧穿到另一侧。
  • 开始、暂停、重新开始:提供开始、暂停和重新开始按钮,方便控制游戏。

如何运行

  1. 克隆仓库

    git clone https://github.com/ZYYO666/my-vue3-snake-demo.git
    cd snake-game
  2. 安装依赖

  3. 运行项目

  4. 打开浏览器
    访问 http://localhost:5173 即可开始游戏。

项目结构

snake-game/
├── public/                # 静态资源
├── src/                   # 项目源代码
│   ├── assets/            # 静态资源
│   ├── components/        # Vue 组件
│   ├── App.vue            # 主组件
│   └── main.js            # 项目入口文件
├── index.html             # HTML 入口文件
├── package.json           # 项目依赖
└── README.md              # 项目说明文件

依赖

  • Vue.js
  • Element Plus (UI 组件库)

贡献

欢迎提交 Issue 和 PR,帮助改进这个项目。

许可证

本项目基于 MIT 许可证开源。