Board games in the desktop game is very mature, Chinese chess version is also very many. Today this Chinese chess game based on HTML5 technology is very distinctive, we can not only choose Chinese chess game difficulty, but also can switch the style of the board. Program write tired, drink a cup of coffee, and computer play a few, believe this HTML5 Chinese chess game Implementation algorithm You are more clear, you can open the source code to study this HTML5 Chinese chess game.
Online preview Source Download
The implemented code.
HTML code:
<Divclass= "box"ID= "box"> <Divclass= "Chess_left"> <CanvasID= "Chess">Sorry, your browser does not support HTML5, please upgrade your browser to IE9, Firefox or Google Chrome!</Canvas> <Audiosrc= "Audio/click.wav"ID= "Clickaudio"preload= "Auto"></Audio> <!--<audio src= "audio/check.wav" id= "Checkaudio" preload= "Auto" ></audio> - <Audiosrc= "Audio/select.wav"ID= "Selectaudio"preload= "Auto"></Audio> <Div> <Divclass= "Bn_box"ID= "Bnbox"> <inputtype= "button"name= "Offensiveplay"ID= "Tyroplay"value= "Beginner Level" /> <inputtype= "button"name= "Offensiveplay"ID= "Superplay"value= "Intermediate level" /> <inputtype= "button"name= "button"ID=""value= "Master Level"Disabled/> <!--<input type= "button" Name= "Offensiveplay" id= "Offensiveplay" value= "initiator start"/> <input t Ype= "button" Name= "Defensiveplay" id= "Defensiveplay " value= "Start with"/> - <inputtype= "button"name= "Regret"ID= "Regretbn"value= "undo" /> <inputtype= "button"name= "Billbn"ID= "Billbn"value= "Chess"class= "Bn_box" /> <inputtype= "button"name= "STYPEBN"ID= "STYPEBN"value= "Skin Change" /> </Div> </Div> </Div> <Divclass= "Chess_right"ID= "Chessright"> <Selectname= "Billlist"ID= "Billlist"> </Select> <olID= "Billbox"class= "Bill_box"> </ol> </Div> <DivID= "Moveinfo"class= "Move_info"> </Div> </Div>
JS referenced by:
<Scriptsrc= "Js/common.js"></Script><Scriptsrc= "Js/play.js"></Script><Scriptsrc= "Js/ai.js"></Script><Scriptsrc= "Js/bill.js"></Script><Scriptsrc= "Js/gambit.js"></Script>
via:http://www.w2bc.com/article/20596
Chinese chess game based on HTML5 implementation