# game_snake_mini_with_typescript
一个基于纯 TypeScript + Webpack + Less 实现的迷你 web 版贪吃蛇小游戏。
<div><img src="https://github.com/yanbober/game_snake_mini_with_typescript/blob/main/images/photo.png" width="350"></div>
## 项目使用
请确保已安装 node 即 npm 相关基本环境。
### 安装依赖
项目根目录下执行如下命令:
```
npm i
```
### 编译打包运行
项目根目录下执行如下命令:
```
npm run pack
```
编译完成后,使用浏览器打开根目录下 dist 目录中的 index.html,然后按键盘上下左右键即可开始游戏。
### 开发调试运行
项目根目录下执行如下命令:
```
npm run dev
```
使用浏览器打开终端提示链接即可,修改代码后保存自动重新编译部署刷新浏览器。
## 项目依赖清单
### TypeScript
- typescript
- ts-loader
### webpack
- webpack
- webpack-cli
- webpack-dev-server
- html-webpack-plugin
- clean-webpack-plugin
### Babel
- core-js
- babel-loader
- @babel/core
- @babel/preset-env
### CSS & Less
- style-loader
- css-loader
- less
- less-loader
- postcss
- postcss-loader
- postcss-preset-env
## LICENSE
MIT License
Copyright (c) 2022 yanbo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
没有合适的资源?快使用搜索试试~ 我知道了~
一个基于纯 TypeScript + Webpack + Less 实现的迷你 web 版贪吃蛇小游戏
共15个文件
ts:5个
json:3个
license:1个
0 下载量 158 浏览量
2024-04-05
11:21:53
上传
评论
收藏 155KB ZIP 举报
温馨提示
非常适合 TypeScript 初学者实战的应用,完整实现了贪吃蛇功能。 项目依赖清单 TypeScript typescript ts-loader webpack webpack webpack-cli webpack-dev-server html-webpack-plugin clean-webpack-plugin Babel core-js babel-loader @babel/core @babel/preset-env CSS & Less style-loader css-loader less less-loader postcss postcss-loader postcss-preset-env
资源推荐
资源详情
资源评论
收起资源包目录
game_snake_mini_with_typescript-main.zip (15个子文件)
game_snake_mini_with_typescript-main
webpack.config.js 2KB
src
modules
Snake.ts 5KB
GameControl.ts 3KB
ScorePanel.ts 1KB
Food.ts 1KB
style
index.less 1KB
index.html 619B
index.ts 249B
LICENSE 1KB
package.json 981B
package-lock.json 552KB
.gitignore 2KB
images
photo.png 25KB
tsconfig.json 122B
README.md 2KB
共 15 条
- 1
资源评论
工匠若水
- 粉丝: 7916
- 资源: 48
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功