Giter Site home page Giter Site logo

games's Introduction

💣mines_sweeping

用vue简单实现了一个扫雷游戏(仿造google游戏做的ui)

主要功能
  • 初始化游戏画板 : 根据游戏难度,控制格子和扫雷的数量,根据初始化数据,生成一个二维数组,

    每个元素为一个对象(用于维护每个格子的状态)

  • 随机生成扫雷💣,Math.random() 随机生成扫雷坐标,修改对应格子的状态。

    let randomRowCoordinate = Math.floor(Math.random() * this.ROW);
    let randomColumnCoordinate = Math.floor(Math.random() * this.COLUMN);
    
  • 计算周围的扫雷数量

  • 左键点开格子

    这个是游戏的核心功能。大致的逻辑就是,如果点开一个格子周围没有扫雷,打开周围的格子,如果周围的格子里还有空白格(不是空白格就显示周围扫雷数量),继续打开周围的格子(这个过程是递归的)。

  • 右键标记扫雷

    右键标记扫雷,显示🚩,扫雷剩余数量 -1

games's People

Contributors

lory02 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.