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

推荐订阅源

L
LangChain Blog
TaoSecurity Blog
TaoSecurity Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
SecWiki News
SecWiki News
L
LINUX DO - 最新话题
Google Online Security Blog
Google Online Security Blog
V2EX - 技术
V2EX - 技术
Help Net Security
Help Net Security
Security Latest
Security Latest
T
Troy Hunt's Blog
腾讯CDC
WordPress大学
WordPress大学
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hacker News: Front Page
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
T
Threatpost
博客园 - Franky
MongoDB | Blog
MongoDB | Blog
Microsoft Security Blog
Microsoft Security Blog
V
Vulnerabilities – Threatpost
S
Secure Thoughts
M
MIT News - Artificial intelligence
量子位
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
G
Google Developers Blog
Jina AI
Jina AI
PCI Perspectives
PCI Perspectives
C
Cisco Blogs
罗磊的独立博客
Y
Y Combinator Blog
The GitHub Blog
The GitHub Blog
Last Week in AI
Last Week in AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Cybersecurity and Infrastructure Security Agency CISA
有赞技术团队
有赞技术团队
Application and Cybersecurity Blog
Application and Cybersecurity Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
H
Help Net Security
The Hacker News
The Hacker News
Cyberwarzone
Cyberwarzone
N
News and Events Feed by Topic
aimingoo的专栏
aimingoo的专栏
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
J
Java Code Geeks
N
News and Events Feed by Topic
S
Securelist

博客园 - 里沃特

XR806开发板环境搭建记录 谈谈把网站迁移到阿里云的一些感想和其中遇到的一些问题 HTML5+JS 《五子飞》游戏实现(八)人机对战 HTML5+JS 《五子飞》游戏实现(六)鼠标响应与多重选择 HTML5+JS 《五子飞》游戏实现(五)移动棋子 HTML5+JS 《五子飞》游戏实现(四)夹一个和挑一对 HTML5+JS 《五子飞》游戏实现(三)页面和棋盘棋子 HTML5+JS 《五子飞》游戏实现(二)路线分析和资源准备 HTML5+JS 《五子飞》游戏实现(一)规则 cocos2dx-2.2.1 免 Cygwin 环境搭建(Win8+VS2013+ADT Bundle+android-ndk-r9c) 深入理解 cocos2d-x 坐标系 在VS2010 下编译 cocos2d-x-2.1.4 FFmpeg 1.2 for Android 生成一个动态库 FFmpeg 1.2 for Android 编译动态库 Linq 批量更新数据 C# 统一对 try...catch 的调用,方便保存错误日志。 手机:由全触摸屏失效所想到的 愚人节奉献给大家的礼物,敬请收下 C# 让控件全屏显示(WinForm)
HTML5+JS 《五子飞》游戏实现(七)游戏试玩
里沃特 · 2015-01-17 · via 博客园 - 里沃特

前面第一至第六章我们已经把《五子飞》游戏的基本工作都已经讲得差不多了,这一章主要是把所有的代码分享给大家,然后小伙伴们也可以玩一玩。

至于人机对战的我们放到后面讲进行分析。

试玩地址:http://www.lyout.com/projects/fiveflychess/FiveflyChess7.htm

现在我们来总结一下该小游戏的一些基本定义:

// 定义游戏对象
function GameChess(){
    // 初始配置
    this.init = function ()//...
    // 画棋盘棋子
    this.paint = function ()//...
    this.repaint = function ()//...
    // 开始玩
    this.play = function ()//...
    // 重玩,重置所有棋子
    this.replay = function ()//...
    // 获取索引号
    this.getIndex = function (pDest, pSrc)//...
    // 是否可移动
    this.canMove = function (pDest, pSrc)//...
    // 是否可“挑一对”
    this.canCarry = function (chess)//...
    // 是否可“夹一个”
    this.canClip = function (chess)//...
    // 移动棋子
    this.moveChess = function (pDest, pSrc)//...
    // 游戏结束
    this.isGameOver = function (player)//...
    // 得到对方是哪个玩家
    this.getAnotherPlayer = function (player)//...
    // 游戏开始(包括加载)
    this.start = function (el)//...
}

HTML5+JS 《五子飞》游戏实现(一)规则

HTML5+JS 《五子飞》游戏实现(二)路线分析和资源准备

HTML5+JS 《五子飞》游戏实现(三)页面和棋盘棋子

HTML5+JS 《五子飞》游戏实现(四)夹一个和挑一对

HTML5+JS 《五子飞》游戏实现(五)移动棋子

HTML5+JS 《五子飞》游戏实现(六)鼠标响应与多重选择