zoukankan      html  css  js  c++  java
  • 基于HTML5实现的中国象棋游戏

    棋类游戏在桌面游戏中已经非常成熟,中国象棋的版本也非常多。今天这款基于HTML5技术的中国象棋游戏非常有特色,我们不仅可以选择中国象棋的游戏难度,而且可以切换棋盘的样式。程序写累了,喝上一杯咖啡,和电脑对弈几把吧,相信这HTML5中国象棋游戏的实现算法你比较清楚,可以打开源码来研究一下这款HTML5中国象棋游戏。

    在线预览   源码下载

    实现的代码。

    html代码:

        <div class="box" id="box">
            <div class="chess_left">
                <canvas id="chess">对不起,您的浏览器不支持HTML5,请升级浏览器至IE9、firefox或者谷歌浏览器!</canvas>
                <audio src="audio/click.wav" id="clickAudio" preload="auto"></audio>
                <!--<audio src="audio/check.wav" id="checkAudio" preload="auto"></audio>-->
                <audio src="audio/select.wav" id="selectAudio" preload="auto"></audio>
                <div>
                    <div class="bn_box" id="bnBox">
                        <input type="button" name="offensivePlay" id="tyroPlay" value="新手水平" />
                        <input type="button" name="offensivePlay" id="superPlay" value="中级水平" />
                        <input type="button" name="button" id="" value="大师水平" disabled />
                        <!--
                <input type="button" name="offensivePlay" id="offensivePlay" value="先手开始" />
                <input type="button" name="defensivePlay" id="defensivePlay" value="后手开始" />
                -->
                        <input type="button" name="regret" id="regretBn" value="悔棋" />
                        <input type="button" name="billBn" id="billBn" value="棋谱" class="bn_box" />
                        <input type="button" name="stypeBn" id="stypeBn" value="换肤" />
                    </div>
                </div>
            </div>
            <div class="chess_right" id="chessRight">
                <select name="billList" id="billList">
                </select>
                <ol id="billBox" class="bill_box">
                </ol>
            </div>
            <div id="moveInfo" class="move_info">
            </div>
        </div>

    引用的js:

    <script src="js/common.js"></script>
    <script src="js/play.js"></script>
    <script src="js/AI.js"></script>
    <script src="js/bill.js"></script>
    <script src="js/gambit.js"></script>

    via:http://www.w2bc.com/Article/20596

  • 相关阅读:
    Winform中在ZedGraph中最多可以添加多少条曲线(转)
    c#委托的含义和用法
    vs2010打开vs2017工程
    C# Socket编程资源
    C# 调用打印机 打印 Excel (转)
    NPOI 教程
    C# 调用C++ DLL 的类型转换(转载版)(转)
    进程间通信(网络阅读笔记)
    NPOI 第二篇 设置样式与合并单元格(转)
    分布式事务的 6 种解决方案,写得非常好!
  • 原文地址:https://www.cnblogs.com/liaohuolin/p/4277710.html
Copyright © 2011-2022 走看看