HTML5+JS 《五子飛》遊戲實現(七)遊戲試玩

來源:互聯網
上載者:User

標籤:

前面第一至第六章我們已經把《五子飛》遊戲的基本工作都已經講得差不多了,這一章主要是把所有的代碼分享給大家,然後小夥伴們也可以玩一玩。

至於人機對戰的我們放到後面講進行分析。

 

試玩地址: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 《五子飛》遊戲實現(六)滑鼠響應與多重選取

HTML5+JS 《五子飛》遊戲實現(七)遊戲試玩

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.