【文件属性】:
文件名称:minesweeper::bomb:网络版经典扫雷
文件大小:52KB
文件格式:ZIP
更新时间:2021-05-24 19:56:10
javascript css game html minesweeper
扫雷车
网络版经典扫雷
入门
克隆存储库
git clone https://github.com/GuilhermeBalog/minesweeper.git
在您喜欢的浏览器上打开index.html文件!
这个怎么运作...
设置
整个游戏都在Game对象中进行
const Game = { ... }
有一些主要属性:
width: 10 ,
height: 8 ,
bombs: 10 ,
field: [],
gameOver: false ,
我决定将字段数组设置为一维数组,因此其长度为width * height 。
每个单元格都有一个值(默认值为0),该值表示周围有多少枚炸弹,并具有一个布尔属性来控制它是否打开
初始化领域
// snippet of the initField() method
for ( let i = 0 ; i < this . fie
【文件预览】:
minesweeper-master
----index.js(11KB)
----index.html(3KB)
----screenshot.png(54KB)
----README.md(3KB)
----style.css(2KB)