Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randos #22

Open
wants to merge 3 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# emoji-minesweeper [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

### game和html的代码基本都看了,有不少地方不是特别清晰,然后在运行时候遇到了问题,就是不知道如何在vscode上面网页运行出来,只能修改代码,但不知道如何具体运行。
### How to play

- Left click to step on a spot
Expand Down
3 changes: 2 additions & 1 deletion game.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,14 @@ Game.prototype.startTimer = function () {
Game.prototype.mine = function (bomb) {
var that = this
var base = document.createElement('span')
var randos = ['🎉', '🎈', '👑', '🎋', '🎊', '🏃', '🚶', '⛄️', '🏈', '🎾', '🚉', '🎳', '🎱', '🎷', '🎲', '🎮', '🚎', '🚓', '🏆', '💵', '🌵', '🌰', '🐎', '🐮', '🐱', '🐤', '🐔', '🐺', '🐶', '🐻', '🐵', '🐕', '💩', '🌟', '©', '✈️', '🍶', '🐦', '😬', '🎁', '🇯🇵', '⚡️', '🙍', '🎅', '📣', '✋', '💔', '💧', '〽️', '💓', '💜']
base.className = 'cell'
base.innerHTML = this.twemoji ? twemoji.parse(this.emojiset[3]) : this.emojiset[3]
base.isMasked = true
if (bomb) base.isBomb = true
base.reveal = function (won) {
var bombemoji = won ? that.emojiset[2] : that.emojiset[1]
var emoji = this.isBomb ? bombemoji : that.numbermoji[this.mine_count]
var emoji = this.isBomb ? bombemoji : (this.mine_count === 0 ? randos[Math.floor(Math.random() * randos.length)] : that.numbermoji[this.mine_count])
this.innerHTML = that.twemoji ? twemoji.parse(emoji) : emoji
this.isMasked = false
this.classList.add('unmasked')
Expand Down